LAOKANG2001 发表于 2022-3-24 23:19:12

用户登录if naem == laokang and andts == 123456:这里为什么有错误

import random
num = random.randint(1,10)
print(num)
naem = input("账号:laokang\n输入:")
andts = int(input("密码:123456\n输入:"))
beam = int(input("验证码:"))
a = 2
b = 0
while 0 <= 3:
    if naem == laokang and andts == 123456:
      print("请输入验证码:")
    elif beam == num:
      print("登录成功\n正在登录......")
    else:
      print("账号或者密码错误!!!")
      print(f"你还有{a}次机会")
      b = b + 1
      a = a -1



Traceback (most recent call last):########想改进验证码到5位数,怎么改
File "C:\Users\Administrator\Desktop\cheshi.py", line 10, in <module>
    if naem == laokang and andts == 123456:
NameError: name 'laokang' is not defined
页: [1]
查看完整版本: 用户登录if naem == laokang and andts == 123456:这里为什么有错误