flag='yes'
#while loop for reccursion
while flag != 'no':
    print ("\n BMI Calculator")
    #Exception block for catching non integer inputs
    try:
        #Prompting user to input weight
        weight = int(input('Enter your weight in pounds : '))
        while weight == 0:
            sys.exit()
    except ValueError:
        print ('Oops!! Kindly enter only numbers.')
        flag = input('Do you want to try again? yes/no : ')
        continue
    try:
        #Prompting user to input height
        height = float(input('Enter your height in inches : '))
        while height == 0:
            sys.exit()
    except ValueError:
        print ('Oops!! Kindly enter only numbers.')
        flag = input('Do you want to try again? yes/no : ')
        continue
    #Function for calculating BMI    
    def bmi_calculator():
        #Exception block for catching division by zero
        try:
            #Formula for calculating BMI
            BMI = round(weight * 703/(height*height), 2)
            return (BMI)
        except ZeroDivisionError:
            print ('Oops!! Cannot divide by zero.')
            sys.exit()
Is there any exception handling available for accepting only non zero inputs? Is there any way to avoid another while or if loop?
 
     
    