got_height = False while not got_height: m_str = raw_input("Enter your height (in metres): ") try: metres = float(m_str) got_height = True # if we're here, it was converted. except: print "Please enter a number." feet = 39.37 * metres / 12 print "You are " + str(feet) + " feet tall."