Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

#-*-coding:utf8;-*-

#qpy:console

print ("This is console module")

def main():

print("1. Addition")

print("2. Subtraction")

print("3. Multiplication")

print("4. Division")

print("5. Quit")

selection = int(input("Choose an Operator: "))

if selection == 1:

add()

elif selection == 2:

sub()

elif selection == 3:

mul()

elif selection == 4:

div()

elif selection == 5:

exit

else:

print("INVALID! Please select only 1-5!")


main()

def add():

a = int(input("Enter your first value: "))

b = int(input("Enter your second value: "))

sum = a + b

print("The Result is: {} ".format(sum))

anykey = input("ENTER ANY KEY TO RETURN")

main()

def sub():

a = int(input("Enter your first value: "))

b = int(input("Enter your second value: "))

sum = a - b

print("The Result is: {} ".format(sum))

anykey = input("ENTER ANY KEY TO RETURN")

main()

def mul():

a = int(input("Enter your first value: "))

b = int(input("Enter your second value: "))

sum = a * b

print("The Result is: {} ".format(sum))

anykey = input("ENTER ANY KEY TO RETURN")

main()
def div():

a = int(input("Enter your first value: "))

b = int(input("Enter your second value: "))

sum = a / b

print("The Result is: {} ".format(sum))

anykey = input("ENTER ANY KEY TO RETURN")

main()

enter=input("If you want to start press anykey: ")

main()

You might also like