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:
#Fill in Miles to KM calc – define the function.