Lab description: Similar to previous lab, we need to create an option that keep coming up until the input is 7, which is exit. And other options will print the calculations of x and y.
option = 1
while option == 1:
option = input (” Menu: (1) Start or Continue (2) Exit”)
if option == 1:
x = input (“Enter x”)
y = input (“Enter y”)
option = input (” Menu: (1) Sum numbers (2) Subtract numbers (3) Multiply numbers (4) Divide numbers (5) Remainder of numbers (6) Compare numbers (7) Exit “)
print option
while option <= 6:
if option == 1:
print “The sum is “, x+y
if option == 2:
print “The difference is “, x-y
if option == 3:
print “The product is “, x*y
if option == 4:
print “The quotient is “, x/y
if option == 5:
print “The remainder is “, x%y
if option == 6:
if x > y:
print “x is greater than y ”
elif y > x:
print “y is greater than x ”
else:
print “x is equal to y ”
option = input (” Menu: (1) Sum numbers (2) Subtract numbers (3) Multiply numbers (4) Divide numbers (5) Remainder of numbers (6) Compare numbers (7) Exit “)