Commit 1cb6b099 by BellCodeEditor

auto save

parent 578e41ee
from random import *
from math import *
from turtle import *
def tree(plist,l,a,f):
if l>2:
nextlist=[]
for p in plist:
p.forward(l)
q=p.clone()
p.left(a)
q.right(a)
nextlist.append(p)
nextlist.append(q)
tree(nextlist,l*f,a,f)
def main():
p=Turtle()
p.color("green")
p.speed(10)
p.pensize(1)
p.left(90)
p.hideturtle()#隐藏箭头
p.penup()#抬笔
p.goto(-100,-100)
p.pendown()#落笔
tree([p],90,60,0.65)
done()
main()
\ No newline at end of file
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
total.append(unit)
print(total)
\ No newline at end of file
def new_input():
total = []
while True:
money= input("请输入:")
if money== 'q':
break
else:
try:
money = int(money)
except:
print("请重新输入一个数字")
else:
total.append(money)
finally:
print("-"*30)
return total
def sum(unit):
count = 0
for i in unit:
count += i
return count
\ 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