c = 0 for x in range(10): for y in range(5): c += 1 print(c) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

c = 0 for x in range(10): for y in range(5): c += 1 print(c)

Can anyone explain me it's output??

12th Jun 2021, 5:51 AM
Deepak Murmu
Deepak Murmu - avatar
3 Answers
+ 4
For each iteration of outer loop inner loop runs full . so after every iteration of outer loop (1+1+1+1+1) = 5 is added to c . And value of c is printed 10 times 5 5+5 10+5 15+5 ......... ......... 50
12th Jun 2021, 6:07 AM
TOLUENE
TOLUENE - avatar
+ 2
Thank you very much sir
12th Jun 2021, 6:08 AM
Deepak Murmu
Deepak Murmu - avatar
0
Anyone???
12th Jun 2021, 6:07 AM
Deepak Murmu
Deepak Murmu - avatar