Python 内置函数 公共方法
for 变量 in 集合: 循环体代码 else: 没有通过 break 退出循环,循环结束后,会执行的代码


# 意思是 a 是不是不在hello里面 temp = "a" not in "hello" print(temp) # 意思是 a 是不是在hello里面 temp2 = "a" in "hello" print(temp2)
for 变量 in 集合: 循环体代码 else: 没有通过 break 退出循环,循环结束后,会执行的代码


# 意思是 a 是不是不在hello里面 temp = "a" not in "hello" print(temp) # 意思是 a 是不是在hello里面 temp2 = "a" in "hello" print(temp2)