''' Purpose: relate a cautionary tale -- make sure your expressions do what they are supposed to do ''' # get Celsius temperature c reply = input( 'Enter Celsius temperature: ' ) c = int( reply ) print( ) # compute respectively, f1 and f2, the decimal and integer Fahrenheit equivalents of c # Order of Operations: Multiplication/division before addition/substraction f1 = 9/5 * c + 32 # f2 = 9//5 * c + 32 f2 = 9 * c // 5 + 32 # Be careful where you do division/multiplication # to get the right result! # Why 9//5 * c + 32 doesn't work: # 9/5 = 1.?? = integer of 1.?? is 1! # display results print( c, 'C =', f1, 'F' ) print( ) print( c, 'C =', f2, 'F' )