Python Turtle - Love Heart Tutorial

preview_player
Показать описание
Learn how to code a love heart using Python code.
Рекомендации по теме
Комментарии
Автор

Good One.
Add at last line,
turtle.done()
for holding the output

badrigs
Автор

programmer's gf here trying to do something for him ha. this is great! do you think it would be possible for this to open with some music? is there a way to paste a code somewhere there with an mp3 track? ♥

Hurriicane
Автор

thanks for the explanation of the code great video by the way

moctard
Автор

How would you change the code to draw a smaller heart? I tried experimenting with smaller integers inside the curve's for loop, with smaller floats inside the forward and left, and with smaller floats inside the forward statement outside of the curve function but no luck. It always draws an incomplete heart and I can't figure it out!

DarkSaruman
Автор

Replit says there's an error in line 13 and line 5 but idk what?
import turtle
turtle.bgcolor("black")
turtle.pensize(2)
def curve ():
for i in range:
turtle.right(1)
turtle.forward(1)
turtle.speed(0)
turtle.color("Red", "Pink")
turtle.begin_fill()
turtle.left(140)
turtle.forward(111.65)
curve ()
turtle.left(120)
curve ()
turtle.forward(111.65)
turtle.end_fill()
turtle.hideturtle()

lovinmyg
Автор

how to stop the animation at the end. The windows will break automatic

下饭王直播
Автор

if you want to change the size, change the value of "size"

import time
from turtle import *

pen= Turtle()
pen.color('red')
bgcolor('black')

def draw_heart(size):
pen.color('red')
pen.pensize(2)
pen.pendown()
pen.setheading(150)
pen.begin_fill()
pen.fd(size)
pen.circle(size * -3.745, 45)
pen.circle(size * -1.431, 165)
pen.left(120)
pen.circle(size * -1.431, 165)
pen.circle(size * -3.745, 45)
pen.fd(size)
pen.end_fill()



draw_heart(62)
pen.ht()
done()

cyberded
Автор

how would i write i love you in the middle

zuberi
Автор

good video
Question, what code editor is that?

miqueasvallejos
Автор

hey i want to ask something, my bf is programmer . he asked me to do this :
1. open cmd
2. type python
3. then for i in
4. print( *sweet stuff* )

but when i press enter nothing happened, what should the output be?

sofwaz.
Автор

Thank you so much bro it's so cool!

zenzi_
Автор

sorry, i keep getting this error
AttributeError: partially initialized module 'turtle' has no attribute 'bgcolor' (most likely due to a circular import)
please help?

konrad
Автор

It is showing syntax error in google colab

mayanksingh
Автор

hi! is it possible to add a text at the middle of the heart?

yukino
Автор

what does the 200 in 'for i in range(200):' mean?

yuracooper
Автор

This code does not run in Pycharm. Do i have to use something else?

saugatoadhikary