0% found this document useful (0 votes)
29 views8 pages

Codigos de Programacion

The document imports the turtle module and defines functions to draw the petals of a sunflower and the full sunflower. It then draws the sunflower, writes a message, and draws additional shapes including a heart and roses using turtle graphics methods like circles, pensize, color, fill, etc.

Uploaded by

María Paula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views8 pages

Codigos de Programacion

The document imports the turtle module and defines functions to draw the petals of a sunflower and the full sunflower. It then draws the sunflower, writes a message, and draws additional shapes including a heart and roses using turtle graphics methods like circles, pensize, color, fill, etc.

Uploaded by

María Paula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

import turtle

screen = turtle.Screen()

screen.bgcolor("skyblue")

t = turtle.Turtle()

t.shape("turtle")

t.color("brown")

t.speed(0)

def dibujar_petal(t, radio):

t.pensize(2)

t.pencolor("black")

t.color("yellow")

t.begin_fill()

t.circle(radio, 60)

t.left(120)

t.circle(radio, 60)

t.end_fill()

t.pencolor("brown")

t.pensize(1)

def dibujar_girasol():

radio = 100

t.penup()

t.goto(0, -100)

t.pendown()

t.pensize(8)

t.left(90)

t.color("green")

t.forward(180)

for _ in range(18):
dibujar_petal(t, radio)

t.right(20)

t.penup()

t.goto(8, 80)

t.pendown()

t.color("brown")

t.begin_fill()

t.circle(10)

t.end_fill()

t.penup()

t.goto(-400, -100)

t.pendown()

t.color("green")

t.begin_fill()

for _ in range(2):

t.forward(800)

t.right(90)

t.forward(200)

t.right(90)

t.end_fill()

dibujar_girasol()

t.penup()

t.goto(0, 200)

t.color("red")

t.write("De mi para ti...", align="center", font=("Arial", 6, "bold"))


t.hideturtle()
from turtle import *

import turtle as tur

tur.bgcolor("darkgrey")

tur.penup()

tur.left(90)

tur.fd(200)

tur.pendown()

tur.right(90)

tur.fillcolor("yellow")

tur.begin_fill()

tur.circle(10, 180)

tur.circle(25, 110)

tur.left(50)

tur.circle(60, 45)

tur.circle(20, 170)

tur.right(24)

tur.fd(30)

tur.left(10)

tur.circle(30, 110)

tur.fd(20)

tur.left(40)

tur.circle(90,70)

tur.circle(30, 150)

tur.right(30)

tur.fd(15)

tur.circle(80, 90)

tur.left(15)

tur.fd(45)

tur.right(165)
tur.fd(20)

tur.left(155)

tur.circle(150, 80)

tur.left(50)

tur.circle(150, 90)

tur.end_fill()

tur.left(150)

tur.circle(-90, 70)

tur.left(20)

tur.circle(75,105)

tur.setheading(60)

tur.circle(80, 98)

tur.circle(-90, 40)

tur.left(180)

tur.circle(90, 40)

tur.circle(-80, 98)

tur.setheading(-83)

tur.fd(30)

tur.left(90)

tur.fd(25)

tur.left(45)

tur.fillcolor("dark green")

tur.begin_fill()

tur.circle(-80, 90)

tur.right(90)

tur.circle(-80, 90)

tur.end_fill()

tur.right(135)

tur.fd(60)
tur.left(180)

tur.fd(85)

tur.left(90)

tur.fd(80)

tur.right(90)

tur.right(40)

tur.fillcolor("green")

tur.begin_fill()

tur.circle(80, 90)

tur.left(90)

tur.circle(80, 90)

tur.end_fill()

tur.left(135)

tur.fd(60)

tur.left(180)

tur.fd(60)

tur.right(90)

tur.circle(200, 60)

tur.penup()

tur.goto(0, 310)

tur.pendown()

tur.color("black")

tur.write("Para ti hermosa!!", align="center", font=("Stencil", 45, "italic"))

tur.penup()

tur.goto(330, 310)

tur.pendown()

tur.fillcolor("red")

tur.begin_fill()

tur.pensize(1)
tur.left(140)

tur.forward(40)

for _ in range(200):

tur.right(1)

tur.forward(0.3)

tur.left(120)

for _ in range(200):

tur.right(1)

tur.forward(0.3)

tur.forward(40)

tur.end_fill()

You might also like