Computer Science, asked by chandansinghnegi01, 1 month ago

Write the output of the followings.
X=10
y=5
for i in range( x - y * 2):
print ("%" ,i)​

Answers

Answered by lakshmimaruboina8688
0

Explanation:

X=10

Y=5

Is given

For loop should run from 0 to x-y\times× 2

That is from 0 to 10-5\times× 2(0)

So the loop should run from 0 to 0

So the loop never runs

So nothing is printed

Corrrection:

print("%",;)

actually this syntax is wront for print()

so it shows syntax error

if it is print(i);

then its correct but the for loop runs 0 times so nothing is printed

excecution:

x=10

y=5

for i in range(x-y\times× 2):

print(i)

OUTPUT:

Program finished without any errors

Similar questions