0 Members and 2 Guests are viewing this topic.
def weight_for_p(): global weight_p print "How much does your pork weigh(kg)?" weight_p = float(raw_input(">"))
def weight_for_p(): global weight_p isnt_num=True #loop once while isnt_num: #loop if weight_p isn't a number print "How much does your pork weigh(kg)?" try: isnt_num=False #don't loop again weight_p = float(raw_input(">")) except ValueError: #if there is a value error, do this isnt_num=True #loop again print "you suck at inputting numbers" #print that you suck at inputing numbers