Give the output of the following python statements.
y=5
for lin rangel1,3):
forj in range(0,1);
z=i+j-1 2-0
if
(z%2)==0:
y=y+z
elif
(z%3)==0:
y=y+z-2
print ("y=",y)
Answers
Answered by
0
The given program is in wrong format
Answered by
1
The whole code is in wrong format, but consider fixing them you code should be:
y=5
for i in range(1,3):
for j in range(0,1):
z=i+j-12-0
if (z%2)==0:
y=y+z
elif (z%3)==0:
y=y+z-2
print ("y=",y)
If the code is this, then output should be
y= -5
y=5
for i in range(1,3):
for j in range(0,1):
z=i+j-12-0
if (z%2)==0:
y=y+z
elif (z%3)==0:
y=y+z-2
print ("y=",y)
If the code is this, then output should be
y= -5
Similar questions
English,
2 months ago
Hindi,
2 months ago
World Languages,
2 months ago
India Languages,
5 months ago
Computer Science,
5 months ago
Math,
10 months ago
English,
10 months ago
English,
10 months ago