Question: Answer R 3 . 2 by setting x = 5 and y = 3 , copying over both blocks of code, adding print ( s

Answer R3.2 by setting x=5 and y=3, copying over both blocks of code, adding print(s) to the end of each block to see what is in the variable s, and commenting what the difference is. Also explain in a comment why you are getting different behavior from each section of code.
Explain the difference between
s=0
ifx>0:
s=s+1
if y >0 :
s=s+1
And
s=0
ifx>0:
s=s+1
elify>0:
s=s+1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!