Commit 0fa324b8 by BellCodeEditor

auto save

parent c1f6aa03
Showing with 33 additions and 11 deletions
def new_input(): import turtle
total = []
while True: # 设置画布大小
unit= input("请输入:") turtle.setup(400, 400)
if unit== 'q':
break # 创建画笔
else: pen = turtle.Pen()
total.append(unit) pen.width(20)
print(total)
new_input() # 设置起始位置
\ No newline at end of file pen.penup()
pen.goto(-50, 100)
pen.pendown()
# 绘制Z形图形
pen.forward(200)
pen.right(135)
pen.forward(280)
pen.left(135)
pen.forward(200)
# 隐藏画笔
pen.hideturtle()
# 关闭画布
turtle.done()
\ No newline at end of file
size=int(input("请输入正方形的边长"))
a=4*size
b=size*size
print("正方形的周长是:"+str(a))
print("正方形的面积是:"+str(b))
\ 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