Lab description: In this lab we are learning how the option, if, elif, if, and print works in python. And also learn that how while loop works, loop is very important part of programming.

option = 1

while option == 1:
option = input (“Menu: (1) Enter numbers (2) Exit”)
print option
if option == 1:
x = input (“Enter x “)
y = input (“Enter y “)
print “The sum is “, x+y
print “The difference is “, x-y
print “The product is “, x*y
print “The quotient is “, x/y
print “The remainder is “, x%y
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 ”

 

Lab2