成员运算符
# in 和 not in word='hello' x=input('请输入一个字符') # 判断用户输入的是否存在于字符串 for c in word: if c==x: print('您输入的内容存在') break else: # 没走break就走else,且跳出for循环 print('您输入的不存在')
# in 和 not in word='hello' x=input('请输入一个字符') # 判断用户输入的是否存在于字符串 for c in word: if c==x: print('您输入的内容存在') break else: # 没走break就走else,且跳出for循环 print('您输入的不存在')