import turtle
rules = {
"A": "A-B--B+A++AA+B-",
"B": "+A-BB--B-A++A+B",
'+': '+',
'-': '-'
}
axiom = ['A']
level = 5
for i in range(level):
p = []
for j in range(len(axiom)):
s = list(rules[axiom[j]])
p.extend(s)
axiom = p
print(axiom)
t = turtle.Turtle()
for l in axiom:
if l in ['A', 'B']:
t.forward(10)
elif l == '+':
t.left(60)
elif l == '-':
t.right(60)