pass:不做任何事情,只起到占位的作用
exit():结束整个程序
for i in "Python":
if i == "y":
pass
else:
print(i)
print("#" * 10)
for i in "Python":
if i == "t":
exit()
else:
print(i)
print("#" * 10)
for i in range(10):
print(i)
输出结果:
P
t
h
o
n
##########
P
y