I'm trying to run a code that will draw a LOVE image using pycharm but i get an error that i seem unable to fix. Please, i need help with this. what am i doing wrong?
'''
Traceback (most recent call last):
File "/home/itgeekng/PycharmProjects/test/love.py", line 24, in <module>
heart()
File "/home/itgeekng/PycharmProjects/test/love.py", line 8, in heart
pen.fillcolor('red')
File "/usr/lib/python3.8/turtle.py", line 2294, in fillcolor
return self._color(self._fillcolor)
AttributeError: 'str' object has no attribute '_color'
,,,
i get this error while runing the code below in pycharm i don't know what am doing wrong
'''
import turtle
pen = turtle.Turtle
def curve():
for i in range(200):
pen.right(1)
pen.forward(1)
def heart():
pen.fillcolor('red')
pen.begin_fill()
pen.left(140)
pen.forward(113)
curve()
pen.left(120)
curve()
pen.forward(112)
pen.end_fill()
def txt():
pen.up()
pen.setpos(-68, 95)
pen.down()
pen.color('lightgreen')
pen.write('i love you', font=('verdana', 12, 'bold'))
heart()
txt()
pen.ht()
'''