Description:
This lab is about asking the user to enter two number and with those two numbers the program will do basic operations. The trouble that I had most was figuring out where to put the while command.
Code:
import math
x = input(“please enter the first number:”)
y = input(“Please Enter the second number:”)
while x!=0 or y!=0:
print “The sum of the first number and the second number is”,x+y
print “The difference of the first number and the second number is”,x-y
print “The product of the first number and the second number is”,x*y
print “The quotient of the first number and the second number is”,x/y
print “The remainder of the first number and the second number is”,x%y
if x < y:
print “x is less than y”
elif x > y:
print “x is greater than y”
else:
print “x is equal to y”
x = input(“please enter the first number:”)
y = input(“Please Enter the second number:”)
Screenshot: