[Type C] Python Revision Tour-1 – Chapter 1

|
Table of Contents

10. Write another program printing a table with two columns that helps convert pounds into kilograms.

print("Pounds   Kilograms")
print("-------------------")
for pounds in range(1, 11):
    kilograms = pounds * 0.453592
    print(f"{pounds}        {kilograms}")
Output
Pounds   Kilograms
-------------------
1        0.453592
2        0.907184
3        1.360776
4        1.814368
5        2.26796
6        2.721552
7        3.175144
8        3.628736
9        4.082328
10        4.53592
"Spread the light within, illuminate the hearts around you. Sharing is not just an action, but a sacred journey of connecting souls."~ Anonymous

Leave a Reply

Your email address will not be published. Required fields are marked *