both in while and for loop, if in loop body, no break, no return, no exception is raised, statements in else block will be executed.
1 2 3 4 |
|
this example will print ‘xxx’, even nothing in list and this loop is not executed.
both in while and for loop, if in loop body, no break, no return, no exception is raised, statements in else block will be executed.
1 2 3 4 |
|
this example will print ‘xxx’, even nothing in list and this loop is not executed.