A simple program in Python
 

Program Design
Input the temperature in degrees Celsius (call it celsius)
Calculate fahrenheit as (9/5)celsius + 32
Output fahrenheit

Python code.



# convert.py

# A program to convert Celsius temps to Fahrenheit



def main():

celsius = input("What is the Celsius temperature? ")

fahrenheit = (9.0 / 5.0) * celsius + 32

print "The temperature is", fahrenheit, "degrees Fahrenheit."


main()


Output from
What is the Celsius temperature? 0
The temperature is 32.0 degrees fahrenheit.

What is the Celsius temperature? 100
The temperature is 212.0 degrees fahrenheit.

Python Keywords


and
del
for
is
raise
assert
elif
from
lambda
return
break
else
global
not
try
class
except
if
or
while
continue
exec
import
pass
yield
def
fnally
in
print

(c) Shilpa Sayura Foundation 2006-2017