# Week 5 Ch 6 Ex 2 # Feet to inches - The program asks the user to enter a dimension in Feet an uses a function # to convert feet to inches # Written by Greg Lamb # Last modified on 04/22/2015 # The function that converts feet to inches follows: def feetToInches(feet): return feet * 12.0; # Get the number of feet to be converted to inches. feet = float(input("Enter the number of feet to convert to inches: ")) # Convert feet to inches inches = feetToInches(feet) print("Congratulations, you've converted {} feet and converted it/them to {} inches.".format(feet,inches))
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