0

What is nested loop in Python?

3rd Dec 2016, 3:49 AM
shivaji singh
shivaji singh - avatar
4 Respuestas
+ 2
Nested loop is when you have a (or more) loop inside loop of your code.
3rd Dec 2016, 4:05 AM
Fendi Septiawan
Fendi Septiawan - avatar
+ 2
A nested loop in Python and in any other programming language is a loop within a loop For example: x = 0 while x < 10: print "I'm the outer loop!" while x < 5: print "I'm the inner loop!" x++
3rd Dec 2016, 4:06 AM
JaKris DeWitt
JaKris DeWitt - avatar
+ 1
A nested loop is a loop within a loop, an inner loop within the body of an outer one: for i in range(10): print('Outer loop') for j in range(10): #that's our nested loop print('Inner loop') @Timorshah In python you write every comand on a new line. And you didn't explain anything. How did you get 6 upvotes? Also, python programmers should use 'for' loops, not 'while'. Shame on you.
3rd Dec 2016, 11:03 AM
donkeyhot
donkeyhot - avatar