Commit 68971f8d by BellCodeEditor

auto save

parent 4b8bc3a2
Showing with 53 additions and 6 deletions
import random
s=input("输入数:")
random.seed(eval(s))
a=random.randint(0,10)
print(a)
\ No newline at end of file
# 和你的小伙伴讲讲史上有名的三英战吕布的故事。然后完成下面挑战,并说说列表切片是什么,怎么用:
import random
x=0
y=0
z=0
while True:
a=input("请输入:石头/剪刀/布:")
print("玩家出拳:",a)
list=["石头","剪刀","布"]
b=list[random.randint(0,2)]
print("电脑出拳:",b)
if a=="石头":
if b=="石头":
print("平局")
y=y+1
if b=="布":
print("玩家败")
z=z+1
if b=="剪刀":
print("玩家胜")
x=x+1
if a=="剪刀":
if b=="石头":
print("玩家败")
z=z+1
if b=="布":
print("玩家胜")
x=x+1
if b=="剪刀":
print("平局")
y=y+1
if a=="布":
if b=="石头":
print("玩家败")
x=x+1
if b=="布":
print("平局")
y=y+1
if b=="剪刀":
print("玩家败")
z=z+1
print("玩家赢的次数:",x,"玩家平局的次数:",y," 玩家输的次数:",z)
\ No newline at end of file
# 省略繁杂情节,刘关张三人一起冲入战场,围攻吕布:
a=['吕布']
b=['袁术','公孙瓒','关羽','张飞','刘备','曹操']
c=b[2:5]
a.extend(c)
from turtle import*
a=pen()
a.forward(100)
done()
\ 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