Saturday, 19 February 2022

Write a program that converts distances measured in kilometers to miles. One kilometer is approximately 0.62 miles.

 CODE

#kmtomiles.py

#Python program :It coverts kilometer to miles 


def main():

    print("This program convert Kilometers to miles")

    km=eval(input("Enter Kilometers ?"))

    miles = 0.62 * km 

    print("Aha , I know Miles are ",miles)

main()


NOTE : save above file as kmtomiles.py

SCREENSHOT



No comments:

Post a Comment