a=['A','B','C','D']
for x in a:
    print(x)

# 当列表里的元素被遍历完后，else分支下的语句块会执行
a=[['A','B','C','D'],(1,2,3)]
for x in a:
    for y in x:
        if y=='B':
            break
        print(y)
else:
    print('END.')

# break 终止当前循环，不会执行else分支下的语句块；continue 跳过当前循环，会执行else分支下的语句块
a = [1,2,3]
for x in a:
    if x==2:
        #break
        continue
    print(x)
else:
    print('END.')

a=[['A','B','C','D'],(1,2,3)]
for x in a:
    if 'B' in x:
        break
    for y in x:
        if y=='B':
            break
        print(y)
else:
    print('END.')

075db75752bd470f9d12727d917fdfa31549c1d8
<mask token>

<mask token>
for x in a:
    print(x)
<mask token>
for x in a:
    for y in x:
        if y == 'B':
            break
        print(y)
else:
    print('END.')
<mask token>
for x in a:
    if x == 2:
        continue
    print(x)
else:
    print('END.')
<mask token>
for x in a:
    if 'B' in x:
        break
    for y in x:
        if y == 'B':
            break
        print(y)
else:
    print('END.')

a = ['A', 'B', 'C', 'D']
for x in a:
    print(x)
a = [['A', 'B', 'C', 'D'], (1, 2, 3)]
for x in a:
    for y in x:
        if y == 'B':
            break
        print(y)
else:
    print('END.')
a = [1, 2, 3]
for x in a:
    if x == 2:
        continue
    print(x)
else:
    print('END.')
a = [['A', 'B', 'C', 'D'], (1, 2, 3)]
for x in a:
    if 'B' in x:
        break
    for y in x:
        if y == 'B':
            break
        print(y)
else:
    print('END.')

a=['A','B','C','D']
for x in a:
    print(x)

# 当列表里的元素被遍历完后，else分支下的语句块会执行
a=[['A','B','C','D'],(1,2,3)]
for x in a:
    for y in x:
        if y=='B':
            break
        print(y)
else:
    print('END.')

# break 终止当前循环，不会执行else分支下的语句块；continue 跳过当前循环，会执行else分支下的语句块
a = [1,2,3]
for x in a:
    if x==2:
        #break
        continue
    print(x)
else:
    print('END.')

a=[['A','B','C','D'],(1,2,3)]
for x in a:
    if 'B' in x:
        break
    for y in x:
        if y=='B':
            break
        print(y)
else:
    print('END.')
