Commit 7b63ae15 by BellCodeEditor

auto save

parent 044077fb
Showing with 47 additions and 18 deletions
r1 = input("请输入一个大于0的边长")
r = float(r1)
zc =r*4
s =r*r
print("正方形的周长是:%d" %zc)
print("正方形的面积是:%d" %s)
\ No newline at end of file
import turtle
pen = turtle.Pen()
pen.penup()
pen.goto(0,-200)
pen.pendown()
pen.circle(200)
pen.penup()
pen.goto(-100,50)
pen.pendown()
pen.fillcolor("blue")
pen.begin_fill()
pen.circle(20)
pen.end_fill()
pen.penup()
pen.goto(100,50)
pen.pendown()
pen.fillcolor("blue")
pen.begin_fill()
pen.circle(20)
pen.end_fill()
pen.penup()
pen.goto(0,50)
pen.pendown()
pen.circle(-50,steps=3)
pen.penup()
pen.goto(-150,-70)
pen.pendown()
pen.goto(0,-170)
pen.goto(150,-70)
pen.hideturtle()
turtle.done()
player = input("请出拳(石头/剪刀/布)")
print("玩家出拳:" + player)
import random
list=["石头","剪刀","布"]
computer = random.choice(list)
print("计算机出拳;"+computer)
if player in list:
if player == computer:
print("平局")
elif (player=="石头" and computer=="剪刀")or(player=="剪刀" and computer=="布")or(player=="布" and computer=="石头"):
print("恭喜,你赢啦")
else:
print("很遗憾,你输啦")
else:
print("输入错误")
\ 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