方法一:
stus=["哈巴狗","小马","小黑"]
username=input("user:")
count=stus.count(username)
if count>0:
print("该用户已经存在")
方法二:
stus=["哈巴狗","小马","小黑"]
username=input("user:")
if username in stus:#在列表里面 not in 不在列表里面
print("该用户已经存在")
方法一:
stus=["哈巴狗","小马","小黑"]
username=input("user:")
count=stus.count(username)
if count>0:
print("该用户已经存在")
方法二:
stus=["哈巴狗","小马","小黑"]
username=input("user:")
if username in stus:#在列表里面 not in 不在列表里面
print("该用户已经存在")