Welcome to my Lab 2!

Description:

This is the second lab exercise using Python 2.7.5. It was a little challenging trying to build this code but once I figured out the base it was easy to do the rest.

Code:

x = input (‘enter x’)
y = input (‘enter y’)
x = int (x)
y = int (y)
while x != 0 and y != 0:
print (x + y)
x = input (‘enter x’)
y = input (‘enter y’)

Screenshot:

Lab2-2

Code:

x = input (‘enter x’)
y = input (‘enter y’)
x = int (x)
y = int (y)
while x != 0 and y != 0:
print (x – y)
x = input (‘enter x’)
y = input (‘enter y’)

Screenshot:

Lab2-4

Code:

x = input (‘enter x’)
y = input (‘enter y’)
x = int (x)
y = int (y)
while x != 0 and y != 0:
print (x * y)
x = input (‘enter x’)
y = input (‘enter y’)

Screenshot:

Lab2-6

Code:

x = input (‘enter x’)
y = input (‘enter y’)
x = int (x)
y = int (y)
while x != 0 and y != 0:
print (x / y)
x = input (‘enter x’)
y = input (‘enter y’)

Screenshot:

Lab2-8

Code:

x = input (‘enter x’)
y = input (‘enter y’)
x = int (x)
y = int (y)
while x != 0 and y != 0:
print (x % y)
x = input (‘enter x’)
y = input (‘enter y’)

Screenshot:

Lab2-15

Code:

x = input (‘enter x’)
y = input (‘enter y’)
x = int (x)
y = int (y)
while x != 0 and y != 0:
if x == y:
print ‘0’
if x < y:
print -1
elif x > y:
print 1
x = input (‘enter x’)
y = input (‘enter y’)

Screenshot:

Lab2-16