Commit 1444b6e6 by BellCodeEditor

auto save

parent 6d88eca4
Showing with 92 additions and 0 deletions
# import turtle
# turtle.begin_fill()
# turtle.color("red","red")
# turtle.penup()
# turtle.goto(-200,150)
# turtle.pendown()
# turtle.pensize(1)
# turtle.speed(0)
# turtle.forward(400)
# turtle.right(90)
# turtle.forward(300)
# turtle.right(90)
# turtle.forward(400)
# turtle.right(90)
# turtle.forward(300)
# turtle.end_fill()
# turtle.penup()
# turtle.right(90)
# turtle.goto(-65,20)
# turtle.pendown()
# turtle.begin_fill()
# turtle.color("yellow","yellow")
# for i in range(5):
# turtle.forward(150)
# turtle.right(144)
# turtle.end_fill()
# turtle.hideturtle()
# turtle.done()
# 求圆的直径,半径和周长
a=float(input("请输入半径:"))
pi=3.1415
print("圆的直径:%.2f"%(2*a),"圆的周长是: %.2f"%(a*2*pi),"圆的面积:%.2f"%(a*a*pi),sep=',')
import turtle
turtle.penup()
turtle.goto(-100,100)
turtle.down()
for i in range(4):
turtle.forward(200)
turtle.right(90)
turtle.penup()
turtle.goto(0,0)
turtle.dot(20,"red")
turtle.goto(-40,0)
turtle.dot(20,"red")
turtle.goto(40,0)
turtle.dot(20,"red")
turtle.hideturtle()
turtle.done()
\ No newline at end of file
def new_input():
total = []
while True:
unit= input("请输入单价:")
if unit== 'q':
break
try:
unit= int(unit)
except:
print('请重新输入一个整数')
else:
if unit== 'q':
break
total.append(unit)
return total
print(total)
w=new_input()
print(w)
\ No newline at end of file
a=int(input("请输入秒数: "))
print(a//3600,a%3600//60,a%60)
import turtle
turtle.penup()
turtle.goto(-90,90)
turtle.pendown()
turtle.begin_fill()
turtle.color("black","red")
for i in range(4):
turtle.forward(180)
turtle.right(90)
turtle.end_fill()
turtle.begin_fill()
turtle.color("black","yellow")
turtle.goto(90,90)
turtle.goto(-90,-90)
turtle.goto(-90,90)
turtle.end_fill()
turtle.hideturtle()
turtle.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