Commit cb3c51e1 by BellCodeEditor

auto save

parent a47e0cbb
Showing with 19 additions and 4 deletions
player=input("请出拳(石头/剪刀/布):")
print("玩家出拳:"+player)
import random
list=["石头","剪刀","布"]
computer=random.choice(list)
print(computer)
\ No newline at end of file
import turtle #import导入库,后面接模块名,调用turtle模块里面的类和方法
pen=turtle.Pen()#实例化一只笔,调用turtle模块中的笔
pen.shape("turtle")# "."表示这个文件/文件夹下的某个内容,设置笔外形(“arrow”,“turtle”,“circle”,“square”,“triangle”,“classic”)六种外形
pen.color("red")#设置填充颜色
pen.begin_fill()#设置填充起点
for i in range(300):
pen.forward(100)
pen.right(97)#for循环,画出一个三角形
pen.end_fill()#设置填充终点
pen.hideturtle()#隐藏画笔
turtle.done()#保存画布
\ No newline at end of file
# 玩家出拳
player=input("请出拳(石头/剪刀/布):")
print("玩家出拳:"player)
\ 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