Computer Science, asked by ssmmps78, 11 months ago

X=10 y=5 for i in range(x-y*2): print("%",;)

Answers

Answered by mad210219
8

Given:

X=10 y=5 for i in range(x-y*2): print("%",;)

To find:

The output

Solution:

X=10

Y=5

Is given

For loop should run from 0 to x-y\times2

That is from 0 to 10-5\times2(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\times2):

   print(i)

OUTPUT:

Program finished without any errors  

Similar questions