Commit a4945d09 by BellCodeEditor

auto save

parent 23dfff73
Showing with 12 additions and 0 deletions
import random #导入random模块
#玩家出拳
player=input("请出拳(剪刀/石头/布):")
#使用input()函数读入玩家出拳并赋值给player
print("玩家出拳:"+player) #输出玩家从屏幕输入的内容
#计算机出拳
list1=["剪刀","石头","布"] #新建出拳类型的列表
computer=random.choice(list1) #随机在列表中选择出拳内容并赋值给computer变量
print("计算机出拳:"+computer)#输出计算机出拳的内容
\ 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