Basic Python Turtle Code: Flower

Publié le: 19 mai 2022
sur la chaîne: Basic Python Turtle Art
491
4

A flower image created by a basic pattern that changes in color as it enlarges. The color transition uses the rgb format.

Feel free to copy and paste the basic Python Turtle code that is given below. Ask questions about the code if you have any. Please enjoy, like, and subscribe! :)

import turtle
t = turtle.Turtle()
screen = turtle.Screen()
screen.colormode(255)
t.pensize(4)
x = 10 #radius of petal = x
t.speed(10)
g = 255
t.left(54)
def flower(x):
for i in range(5):
t.penup()
t.goto(0, 0)
t.forward(x)
t.pendown()
t.color(255, g, 0)
t.circle(.727 * x, 252)
t.right(180)
for i in range(10):
x += 12
g -= 25
flower(x)
t.ht()
screen.exitonclick()


Sur cette page du site, vous pouvez voir la vidéo en ligne Basic Python Turtle Code: Flower durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Basic Python Turtle Art 19 mai 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 491 fois et il a aimé 4 téléspectateurs. Bon visionnage!