More advanced Python

So Python is pretty simple. I’m just doing some basic float based calculations. A converter app of sorts.

See if you can figure out what it does and how.

def cvttemp(): #Temperature Conversion
print (“Enter temperature in Fahrenheit:/n”)
t= float(input (“Temp in F:”))
print (“Temp in C is: “)
print ((t-32)*(5/9)) # Standard F to C calculation in print statement
def cvtctof: #Celsius to Fahrenheit
c= float(input(“Temp in C:”))

def cvtdist(): #KM to Miles
print (“Enter distance in km”)
d=float(input(“Distance in KM:”))

def cvtliquid(): $Liters to Ounces
print(“Enter volume in liters”)
v=input(“Volume in Liters:”)

print (“Prees 1 for F to C”)
print (“Press 2 for C to F”)
print (“Press 3 for KM to Miles”)
print (“Press 4 for Miles to KM”)
print (“Press 5 for Liters to Ounces”)
print (“Press 6 for Ounce to Liters”)

a = int(input (“Enter your choice now: “))

if a == 1:
elif a==2:
elif a==3:
elif a==4:
#Fill in Miles to KM calc – define the function.
elif a==5:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.