Code Example (Input, Process, Output)

You are in a foreign country that uses Fahrenheit for temperature everywhere. However, you are only familiar with Celsius. Write a program to solve the problem.


Input: Ask user to key in a Fahrenheit value

Process: Convert it to Celsius value

Output: Display the Celsius value on the screen


f = input("Enter temperature in F: ")
f = float(f) #convert f from string to float
c = (f - 32) * 5 / 9
print("Temperature in C is " + str(c) )

Last modified: Wednesday, 3 May 2017, 4:29 PM