Notes/ML/HeightConverterProgram-200808-184542.py

12 lines
330 B
Python
Raw Normal View History

2022-04-23 14:04:50 +00:00
#Start with input function
distance = int(input('Input the distance travelled: '))
unit = input('input unit type i.e K for Kms - M for Miles :')
if unit.upper() == "K":
converted = distance/1.609
print(f"You have gone {converted} miles")
else:
converted = distance*1.609
print(f"You have gone {converted} kms")