Lab 2

Description: This lab, in my opinion, was a little challenging. The main reason is because I didn’t really understand what it was I need to do. Therefore I reviewed my notes and the slides provided to me but still I wasn’t quite clear on the exact task. I tried to do what I think it was asking. Therefore I placed two variables for x and y and did a “if” statement. Then preformed every operation giving to me. After getting my results, I simply redo the process but this time with y being equal to 0. However the operation stopped at the division due to 0 can not be divided into x. I felt I did something right but still need some work to get a clear understanding.

 

Code: x=4 y=2

if x>0 print (x+y), print (x-y), print (x*y), print (x/y), print (x%y), print (x>y)

x=4 y=0

 

Screenshot:

iffffstatmentresult if