Computer Science, asked by vimalavishnu477, 4 months ago

for j in range(10,6,-2):

print(j*2)​

Answers

Answered by BrainlyProgrammer
8

Question:-

for j in range(10,6,-2)

print(j*2)

There is one error in this code.. colon is missing...else it will display Syntax error

Correct Code:-

for j in range(10,6,-2):

print(j*2)

Correct Output:-

20

16

Explaination:-

  • The program runs j loop from 10 to 7 with step -2.
  • Each iteration, the product of j and 2 gets displayed
  • Once j becomes 6, loop terminates
Answered by anshugupta6783
1

Answer:

the output is 20 and 16

Explanation:

because the loop will run from the start value that is 10 and I will run till 7 and it will take the step value of minus 2 which gives

10

9

8

7

so we will take 10 and 8 because of the step value and multiply them with two so the output will be 20 and 16

Similar questions