"""====================================================================== Program: Feet to Inches Converter Author: Chris Brockamp Date: April 19, 2015 Dev Env: Python Fiddle Description: Gets the number of feet from the user then calculates the amount of inches in feet and displays it to the user. ======================================================================""" #_declare constant_______________________________________________________ INCHES = 12 #_define functions_______________________________________________________ def feet_to_inches(feet): return feet * INCHES #_main___________________________________________________________________ feet = input("Enter the number of feet you want to convert to inches: ") print(feet) print("There are, " + str(feet_to_inches(feet)) + " inches in " + str(feet) + " feet")
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