Commit 1375c1c6 by BellCodeEditor

auto save

parent dc70412a
Showing with 38 additions and 0 deletions
import turtle
pen=turtle.Pen()
screen=turtle.Screen()
a=screen.textinput("尺寸","你想要多大的三角形")
pen.pencolor("black")
pen.pensize(10)
pen.pendown()
for i in range(3):
pen.forward(int(a))
pen.left(120)
pen.penup()
pen.forward(2*int(a),)
pen.write("三角形",font=("Times",30,"normal"))
turtle.done()
\ No newline at end of file
def func():
total = []
while True:
unit=input("请输入:")
if unit== 'q':
break
else:
try:
unit=int(unit)
except:
print("请重新输入数字")
else:
total.append(unit)
return total
A=func()
def num(x):
B=0
for i in x:
B=B+i
return B
print(num(A))
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