Lab description:

The program we were ask to write is based on Boolean expressions and loops (while loop). The program is meant to ask a user to input two integers, after which the program will do some mathematical problems, display the results and ask the user to input two more integers. If the user inputs zero for either integer, the program stops. The program was easy but a bit confusing to write. The part I found brain steaming was getting the program to stop when the user enters zero for either integers.

Code:

x= int(input ("enter intger for x:"))
y= int(input ("enter integer for y: "))

print ("x+y=",(x+y))
print ("x-y=",(x-y))
print ("x*y=",(x*y))
print ("x/y=",(x/y))
print ("x%y=",(x%y))
if xy:
        print ("x is greater than y")
else:
        print ("x is equal to y")
while x!=0 and y!=0:
        x= int(input ("enter intger for x:"))
        y= int(input ("enter integer for y: "))
        if x==0 or y==0:
                break
        else:
                print ("x+y=",(x+y))
                print ("x-y=",(x-y))
                print ("x*y=",(x*y))
                print ("x/y=",(x/y))
                print ("x%y=",(x%y))
                if xy:
                        print ("x is greater than y")
                else:
                        print ("x is equal to y")

Screenshot: