python 基础 for else

for one in many_list:
    if "k" in one:
        print "在里面"
        break
else:
    print "没有在里面"

如果不在 循环 list 里 走外面的 else

原文地址:https://www.cnblogs.com/angdh/p/10989049.html