Why does it repeat from the top of the if rather than the while statement?
I want to make the "repeat = input("Do you want to perform another calcualtion?(Y/N)") " return to the top of the while function so that it'll ask what kind of operation it'd like to do! Also, besides dictionaries and the 'not in' function, how else can i make this code neater and make "repeat = input("Do you want to perform another calcualtion?(Y/N)") " asked after every if or elif or else statement without manually placing it... THANK YOU! Here's my code... """try to make it repeat!""" repeat = "y" """Import functions here""" from math import pi """Calculator""" #Definitions def add(x,y): return x+y def sub(x,y): return x-y def div(x,y): return x/y def mul(x,y): return x*y def square(x): return x**2 def SquareRoot(x): return x**(1/2) #Code choice = input("Input type of operation!(+,-,*,/,^2,^1/2)") while repeat == "y": if choice == "+" or choice == "plus" or choice == "add" or choice == "-" or choice == "Subtract" or choice =="sub" or choice =="minus" or choice == "/" or choice == "divide" or choice == "division" or choice=="Multiply" or choice == "*" or choice == "times" or choice == "Multiplication": num1 = int(input("ENTER FIRST NUMBER")) num2 = int(input("ENTER SECOND NUMBER")) if choice == "+" or choice == "plus" or choice == "add": print(num1,"+",num2,"=",(num1+num2)) repeat = input("Do you want to perform another calcualtion?(Y/N)") elif choice == "-" or choice == "Subtract" or choice =="sub" or choice =="minus": print(num1,"-",num2,"=",(num1-num2)) repeat = input("Do you want to perform another calcualtion?(Y/N)") elif choice == "/" or choice == "divide" or choice == "division": print(num1,"/",num2,"=",(num1/num2)) repeat = input("Do you want to perform another calcualtion?(Y/N)") elif choice == "Multiply" or choice == "*" or choice == "times" or choice == "Multiplication":