for num
in [1,2,3]
print(num
)
if nun
== 2:
braek
else:
print("会执行吗")
print("循环结束")
students
= [
{"name": "啊土"},
{"name": "小美"}
]
find_name
= "李四"
for stu_dict
in students
:
print(stu_dict
)
if stu_dict
["name"] == find_name
:
print("找到了 %s" % find_name
)
break
else:
print("抱歉美有找到 %s" % find_name
)
print("循环结束")
转载请注明原文地址: https://mac.8miu.com/read-512459.html