Commit 1a053524 by BellCodeEditor

auto save

parent 9e20b7ef
Showing with 116 additions and 2 deletions
username = "python"
userpassword = "123"
i = 3
while True:
user_name = input("请输入账号")
user_password = input("请输入密码")
i -= 1
if i > 0:
if user_name == username and user_password == userpassword:
print("登陆成功")
break
if user_name != username:
print("账号输入错误")
print("您还有"+str(i)+"次机会")
continue
if user_password != userpassword:
print("密码输入错误")
print("您还有"+str(i)+"次机会")
else:
print("您的账户已被锁定~")
exit()
print("欢迎来到贝尔编程")
\ No newline at end of file
......@@ -9,4 +9,8 @@ user_password = input("请输入密码:")
if username == user_name and userpassword == user_password:
print("登陆成功")
else:
print("密码或者账号错误,请重新登陆")
\ No newline at end of file
print("密码或者账号错误,请重新登陆")
\ No newline at end of file
# i = 0
# while i < 5:
# print("悟空")
# i += 1
# if i == 4:
# break
username = "python" # 保存在服务器数据库中的用户账号(正确的账号)
userpassword = "123456" # 保存在服务器数据库中的用户密码(正确的密码)
# 请用input()实现用户输入账号、密码的功能
while True:
user_name = input("请输入账号:")
if username != user_name:
print("账号输入不正确,请重新输入")
user_password = input("请输入密码:")
if userpassword != user_password:
print("密码输入不正确,请重新输入")
# 如果用户输入的账号、密码正确,提示登陆成功
if username == user_name and userpassword == user_password:
print("登陆成功")
break
# else:
# print("密码或者账号错误,请重新登陆")
# print("密码或者账号错误,请重新登陆")
print("欢迎来到贝尔编程")
# i = 0
# while i < 5:
# i += 1
# if i == 4:
# continue
# print(i)
i = 3
username = "python" # 保存在服务器数据库中的用户账号(正确的账号)
userpassword = "123456" # 保存在服务器数据库中的用户密码(正确的密码)
while True:
if i > 0:
user_name = input("请输入账号:")
user_password = input("请输入密码:")
i -= 1
if username == user_name and userpassword == user_password:
print("登陆成功")
break
if username != user_name:
print("账号输入不正确,请重新输入")
print("温馨提示,你还有"+ str(i) + "次机会")
continue
if userpassword != user_password:
print("密码输入不正确,请重新输入")
print("温馨提示,你还有"+ str(i) + "次机会")
# 如果用户输入的账号、密码正确,提示登陆成功
else:
print("机会已经用完")
exit()
print("欢迎来到贝尔编程")
\ No newline at end of file
p = input("玩家出拳:")
import random
list = ["石头","剪刀","布"]
c = random.choice(list)
print("计算机出拳:"+c)
i = 3
while True:
while i != 0:
if p in list:
i -= 1
if p == c:
print("平局")
elif (p=="石头" and c =="剪刀") or (p=="剪刀" and c =="布") or (p=="布" and c =="石头"):
print("玩家赢")
else:
print("计算机赢")
print("还有"+str(i)+"次机会")
else:
print("输入错误")
exit()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment