mirror of
https://gitlab.com/naja42/python-malbuch.git
synced 2024-11-25 09:03:13 +01:00
32 lines
594 B
Plaintext
32 lines
594 B
Plaintext
## Code mit spazierender Schildkröte
|
|
|
|
from turtle import *
|
|
speed(100)
|
|
shape("turtle")
|
|
for i in range (5):
|
|
n = 20
|
|
for j in range (4):
|
|
left(n)
|
|
for k in range (4):
|
|
forward(340)
|
|
left(90)
|
|
n = n + 20
|
|
done()
|
|
|
|
## Code für das Erstellen von einer svg Datei
|
|
|
|
from svg_turtle import SvgTurtle
|
|
t = SvgTurtle(1500, 1500)
|
|
t.speed(0)
|
|
|
|
for i in range (5):
|
|
n = 20
|
|
for j in range (4):
|
|
t.left(n)
|
|
for k in range (4):
|
|
t.forward(340)
|
|
t.left(90)
|
|
n = n + 20
|
|
|
|
t.save_as('PyTurtle8.svg')
|