# -*- coding: utf-8 -*- print "I will convert a temperature from °C to °F:" temp_C = float(raw_input("Please give me a temperature in °C: T = ")) assert -273.5 < temp_C while True: choice = raw_input("Choose between F or K: ") if choice == "F": temp_F = (9./5.) * temp_C + 32 print "So this temperature of", temp_C, "°C, is ", temp_F, "°F." break elif choice == "K": temp_K = temp_C + 273.5 print "So this temperature of", temp_C, "°C, is ", temp_K, "°K." break else: print "Your input", choice, "is not valid. Try again!"