Draw and erase shapes in Python with Turtle: Beginner Coding Tutorial

Publicado em: 01 Julho 2025
no canal de: Rivan
26
3

This is the code to draw and Clear a red square using buttons in Python.

import turtle
t = turtle.Pen()
def redsq50():
turtle.color(1,0,0)
turtle.begin_fill()
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.end_fill()


from tkinter import *
tk = Tk()
btn = Button(tk, text = "red square", command=redsq50)
btn.pack()
def clearscreen():
turtle.clear()
turtle.reset()


btn = Button(tk, text = "Clear all", command=clearscreen)
btn.pack()


Nesta página do site você pode assistir ao vídeo on-line Draw and erase shapes in Python with Turtle: Beginner Coding Tutorial duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Rivan 01 Julho 2025, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 26 vezes e gostou 3 espectadores. Boa visualização!