In Class Python Code

This assignment was to write a small program that computes the range of available ages.

 

#converter.py
#Takes a celsius temp and converts to farenheit
#celsius = int(input(‘What is the temp in Celsius? ‘))
#farenheit = 9 / 5 * celsius + 32
#print(farenheit)
#1/2 age + 7

myAge = eval(input(“What is your current age?”))
compVal = 0.5 * myAge + 7
print(“Your age range is: “, myAge – compVal, ” to “, myAge + compVal)

Comments are closed.