meters = 640 inches = meters*100/2.54 # convert to cm then to inches feet = inches/12 yards = feet/3 miles = yards/1760 print "Given length is equivalent to:" print "%.2f inches" % (inches) print "%.2f feet" % (feet) print "%.2f yards" % (yards) print "%.4f miles" % (miles) ''' Sample run: Given length is equivalent to: 25196.85 inches 2099.74 feet 699.91 yards 0.3977 miles '''
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question