count = 0
count_1=3
name='syw'
pwd='123'
tag=True
while count < 3:
inp_name = input('请输入账号')
inp_pwd = input('passwd')
if inp_name == name and inp_pwd == pwd:
print('successful')
while tag:
cmd=input('请输入命令')
if cmd=='q':
break
print('{x}命令正在运行'.format(x=cmd))
break
else:
print('用户名或密码错误请重试')
count_1 -= 1
print('还有{x}次机会'.format(x=count_1))
count+=1
else:
print('错误次数过多')