[Type C] Python Revision Tour-1 – Chapter 1
Table of Contents
9. Write a program that prints a table on two columns – a table that helps converting miles into kilometers.
print("Miles Kilometers")
print("-------------------")
for miles in range(1, 11):
kilometers = miles * 1.60934
print(f"{miles} {kilometers}")
Output
Miles Kilometers
-------------------
1 1.60934
2 3.21868
3 4.82802
4 6.43736
5 8.0467
6 9.65604
7 11.26538
8 12.87472
9 14.48406
10 16.0934