Commit 2c6e42e8 by BellCodeEditor

auto save

parent 6daac40b
Showing with 76 additions and 0 deletions
name = "python"
password = "111"
i = 3
while True:
if i > 0:
username = input("请输入账号:")
userpassword = input("请输入密码:")
i-=1
if username == name and userpassword == password:
print("登录成功")
break
else:
if username != name:
print("账号输入错误")
print("您还有"+str(i)+"次机会")
continue
if userpassword != password:
print("密码输入错误")
print("您还有"+str(i)+"次机会")
else:
print("没机会了")
exit()
print("欢迎来到贝尔编程")
\ No newline at end of file
name = "python"
password = "111"
i = 3
while True:
if i > 0:
username = input("请输入账号:")
userpassword = input("请输入密码:")
i-=1
if username == name and userpassword == password:
print("登录成功")
break
else:
if username != name:
print("账号错误")
print("您还有"+str(i)+"次机会")
continue
if userpassword != password:
print("密码错误")
print("您还有"+str(i)+"次机会")
else:
print("机会没了")
exit()
print("欢迎来到贝尔编程")
import random
s = 0
while True:
p = input("玩家出拳:")
list = ["剪刀","石头","布"]
c = random.choice(list)
if p in list:
print("玩家出拳"+p)
print("计算机出拳"+c)
if p == c:
print("平局")
elif (p=="石头" and c =="剪刀") or (p=="剪刀" and c =="布") or (p=="布" and c =="石头"):
print("玩家赢")
s += 1
else:
print("你输了")
s -= 1
continue
if p == "q" or p == "Q":
break
else:
print("请正确输入")
if s > 0:
print("恭喜你赢了"+str(s)+"分")
else:
print("很遗憾你输了"+str(s)+"分")
print("游戏结束")
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