Indent problem python --- for, if and else's

Here Insert Picture Description

Today encounter a problem: else either write, write, should be subordinate for or if.

First contact with a concept: the python language, can make up for and else statements, if the for loop ended normally, else the statement is executed. If a break for the end, is not performed. So like to understand, here are some else in fact but not the corresponding and if and for, respectively.
I find this picture very detailed online say the difference between the twoHere Insert Picture Description

Published an original article · won praise 0 · Views 14

Guess you like

Origin blog.csdn.net/Ying_new/article/details/104572433