I got this error when I tried to use a int(integer()) to customize a turtle drawing:
import turtle import math import time
htn = int(input(“Type the amount of hearts you want the turtle to draw –> “))
t = turtle.Turtle() t.speed(0) t.color(“red”) turtle.bgcolor(“black”) t.hideturtle()
def coracao(n): x = 16 * math.sin(n) ** 3 y = 13 * math.cos(n) – 5 * math.cos(2n) – 2math.cos(3n) – math.cos(4n) return y, x
t.penup() for i in range(htn): t.goto(0, 0) t.pendown() for n in range(0, 100, 2): x, y = coracao(n/10) t.goto(yi, xi) t.penup()
turtle.done()
But it keeps giving that error, what can I do to solve this keeping the input??
submitted by /u/Ranch1k
[link] [comments]
r/learnpython I got this error when I tried to use a int(integer()) to customize a turtle drawing: import turtle import math import time htn = int(input(“Type the amount of hearts you want the turtle to draw –> “)) t = turtle.Turtle() t.speed(0) t.color(“red”) turtle.bgcolor(“black”) t.hideturtle() def coracao(n): x = 16 * math.sin(n) ** 3 y = 13 * math.cos(n) – 5 * math.cos(2n) – 2math.cos(3n) – math.cos(4n) return y, x t.penup() for i in range(htn): t.goto(0, 0) t.pendown() for n in range(0, 100, 2): x, y = coracao(n/10) t.goto(yi, xi) t.penup() turtle.done() But it keeps giving that error, what can I do to solve this keeping the input?? submitted by /u/Ranch1k [link] [comments]
I got this error when I tried to use a int(integer()) to customize a turtle drawing:
import turtle import math import time
htn = int(input(“Type the amount of hearts you want the turtle to draw –> “))
t = turtle.Turtle() t.speed(0) t.color(“red”) turtle.bgcolor(“black”) t.hideturtle()
def coracao(n): x = 16 * math.sin(n) ** 3 y = 13 * math.cos(n) – 5 * math.cos(2n) – 2math.cos(3n) – math.cos(4n) return y, x
t.penup() for i in range(htn): t.goto(0, 0) t.pendown() for n in range(0, 100, 2): x, y = coracao(n/10) t.goto(yi, xi) t.penup()
turtle.done()
But it keeps giving that error, what can I do to solve this keeping the input??
submitted by /u/Ranch1k
[link] [comments]