Lab–2–While, for and other Loops
This is my second work in python and is was really difficult for me to do it,because it was my first time doing a program like that. But aside from that is was really fun. I am learning a lot and i like programming. What the programs did was sum, subtract, multiply and divide on its own.
x = input(‘x’)
y = input (‘y’)
x = int (x)
y = int (y)
while (x != 0 and y != 0):
sum = x + y
print sum
x = int (x)
y = int (y)
difference = x – y
print difference
multiplication = x * y
print multiplication
quotient = x / y
print quotient
remainder = x % y
print remainder
x = input(‘x’)
y = input (‘y’)
x = int (x)
y = int (y)
Leave a Reply