Commit facd978d by BellCodeEditor

auto save

parent 92449b0c
Showing with 47 additions and 5 deletions
import time
a = time.time()
print(a)
\ No newline at end of file
list1 = []
for a in range(0, 1000):
for b in range(0, 1000):
list1.insert(0, 0)
\ No newline at end of file
import turtle
import random
s = turtle.Screen()
s.bgcolor('wheat')
p = turtle.Pen()
p.speed(0)
p.up()
p.left(90)
p.backward(100)
p.down()
def tree(n):
if n >= 0:
angle = random.randint(15,30)
lenth = random.randint(1,15)
pencolor = ['snow','lightcoral']
tree_lenth = n - lenth
if tree_lenth < 5:
p.color(random.choice(pencolor))
p.pensize(3)
else:
p.pensize(n/10)
p.color('sienna')
p.forward(n)
p.right(angle)
tree(tree_lenth)
p.left(2*angle)
tree(tree_lenth)
p.right(angle)
p.up()
p.backward(n)
p.down()
tree(50)
turtle.done()
def sum(n):
if n == 1:
return 1
a = n * sum(n - 1)
return a
print(sum(4))
\ 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