Lab 2

Lab Description Creating a while loop that can be broken by choice.

print("Choose 1)Start 2)Exit")
Option=input()
x= input ('Enter First Number')
y= input ('Enter Second Number')
print ()
z=int(x)
b=int(y)
my_sum= z+b
my_difference= z-b
my_product= z*b
my_qoutient= z/b
my_remainder= z%b
print(("1-sum of numbers:"),(my_sum))
print(("2-difference of numbers:"),(my_difference))
print(("3-product of numbers:"),(my_product))
print(("4-qoutient of numbers:"),(my_qoutient))
print(("5-remainder of numbers:"),(my_remainder))
if z>b:
print(("6-z greater than b"))
elif b>z:
print(("6-b greater than z"))
else:
print(("6-z equal to b"))

while Option==input(1):
print (input('Choose 1)start 2)Exit'))
if Option==input(2):exit(2)

x= input ('Enter First Number')
y= input ('Enter Second Number')
print ()
z=int(x)
b=int(y)
my_sum= z+b
my_difference= z-b
my_product= z*b
my_qoutient= z/b
my_remainder= z%b
print(("1-sum of numbers:"),(my_sum))
print(("2-difference of numbers:"),(my_difference))
print(("3-product of numbers:"),(my_product))
print(("4-qoutient of numbers:"),(my_qoutient))
print(("5-remainder of numbers:"),(my_remainder))
if z>b:
print(("6-z greater than b"))
elif b>z:
print(("6-b greater than z"))
else:
print(("6-z equal to b"))

CLab2
CLab2

Leave a Reply

Your email address will not be published. Required fields are marked *