Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Python program to convert Kilometer to Miles

In this post, we are going to see how to Convert Kms to Miles using a simple Python script. The formula for converting Kilometer to Miles is very simple, just dividing the value by 1.609.

Let’s write the program now,

#get the Kilometer from user
print ("Enter km")
km = float(input())

#convert km to miles
miles = km / 1.609
print ("Miles: %0.4f" %miles)

Sample output of the above program:

Enter km:
10
Miles: 6.2150

It’s very simple, right? Hope this post is useful for you. Thanks.

The post Python program to convert Kilometer to Miles appeared first on TutorialsMade.



This post first appeared on TutorialsMade - Ultimate Tutorial, please read the originial post: here

Share the post

Python program to convert Kilometer to Miles

×

Subscribe to Tutorialsmade - Ultimate Tutorial

Get updates delivered right to your inbox!

Thank you for your subscription

×