我试图给自己编写一个登录和注册脚本,但我的用户名定义有问题。我可以不使用任何验证方法运行代码,但如果使用了验证方法,代码似乎总是会中断。你知道吗
usernameloop = 1
while usernameloop == 1:
username = input("Please input your desired username.")
if len(username) >> 20:
print("Unable to choose that username, you need to have less than 20 characters in your username.")
elif len(username) >= 4 and len(username) <= 20:
print("Username Selected. Your username is:", username)
time.sleep(1)
usernameloop = 0
break
# This is the problematic statement. It doesn't work if this is in and always goes to this statement even if the validation should be correct.
elif len(username) << 4:
print("Unable to choose that username, you need 3 or more characters in your username.")
else:
print("An Unknown Error Occurred, contact x with the screenshot of the conversation history.")
time.sleep(10)
exit()
有人知道它为什么不起作用吗?我不知道它为什么不起作用。你知道吗
用单个'<;'或'>;'代替'<;'或'>;',就可以了。你知道吗
>
是Comparison Operators>>
是bitwise oprator相关问题 更多 >
编程相关推荐