Cómo hacer un árbol por python

Ejemplos de código

2
0

cómo hacer un árbol por python

import turtle
arrow=turtle.Turtle()
arrow.color ("green")
window=turtle.Screen()
window.bgcolor("cyan")
arrow.begin_fill()
arrow.forward(100)
arrow.setheading(120)
arrow.forward(100)
arrow.setheading(240)
arrow.forward(100)
arrow.setheading(270)
arrow.end_fill()
arrow.penup()
arrow.forward(60)
arrow.pendown()
arrow.begin_fill()
arrow.setheading(0)
arrow.forward(100)
arrow.setheading(120)
arrow.forward(100)
arrow.setheading(240)
arrow.forward(100)
arrow.setheading(270)
arrow.end_fill()
arrow.penup()
arrow.setheading(0)
arrow.forward(40)
arrow.pendown()
arrow.begin_fill()
arrow.color("brown")
arrow.setheading(270)
arrow.forward(50)
arrow.setheading(0)
arrow.forward(20)
arrow.setheading(90)
arrow.forward(50)
arrow.end_fill()
arrow.penup()
arrow.forward(150)
arrow.setheading(180)
arrow.forward (125)
arrow.pendown()
arrow.color ("green")
arrow.begin_fill()
arrow.setheading(120)
arrow.forward(100)
arrow.setheading(240)
arrow.forward(100)
arrow.setheading(270)
arrow.end_fill()
arrow.penup()
arrow.forward(60)
arrow.pendown()
arrow.begin_fill()
arrow.setheading(0)
arrow.forward(100)
arrow.setheading(120)
arrow.forward(100)
arrow.setheading(240)
arrow.forward(100)
arrow.setheading(270)
arrow.end_fill()
arrow.penup()
arrow.setheading(0)
arrow.forward(40)
arrow.pendown()
arrow.begin_fill()
arrow.color("brown")
arrow.setheading(270)
arrow.forward(50)
arrow.setheading(0)
arrow.forward(20)
arrow.setheading(90)
arrow.forward(50)
arrow.end_fill()
arrow.penup()
arrow.forward(30)
arrow.color("green")
turtle.done

Páginas relacionadas

Páginas de ejemplo relacionadas

En otros idiomas

Esta página está en otros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................