Python error "AttributeError: 'Turtle' object has no attribute 'Shape'"

+1 vote

I'm trying to build the snake game using the python module turtle. This is my code

import turtle

#set up the screen
wn = turtle.Screen()
wn.title("snake game")
wn.bgcolor("Blue")
wn.setup(width=600, height=600)
wn.tracer(0)

#Snake Head
head = turtle.Turtle()
head.speed(0)
head.Shape("Square")
head.color("Black")
head.penup()
head.goto(0, 0)
head.direction = "stop"
turtle.mainloop()

Error:

  head.Shape("Square")
AttributeError: 'Turtle' object has no attribute 'Shape'

Jun 19, 2019 in Python by Nagya
2,820 views

1 answer to this question.

+1 vote

Hey @Nagya, replace

python.Shape("Square")

with the following:

python.shape("square")

Python is case sensitive

answered Jun 19, 2019 by Faiza
Nagya is asking about atrribute and ur telling that python is case sensitive....

Well, the attribute here is "square" and since python is case sensitive, "Square" and "square" make a difference.

Hence the error:

AttributeError: 'Turtle' object has no attribute 'Shape'

Related Questions In Python

0 votes
1 answer

Python Pandas error: AttributeError: 'DataFrame' object has no attribute 'rows'

There is no attribute called “rows”. The ...READ MORE

answered Mar 28, 2019 in Python by Shri
14,175 views
0 votes
1 answer

Python error "AttributeError: '_Screen' object has no attribute 'onkeypress'"

Instead of  wn.onkeypress(go_up, "w") Try wn.onkey(go_uo, "w ...READ MORE

answered Jul 4, 2019 in Python by Pooja
631 views
0 votes
1 answer

Python error "'str' object has no attribute 'turtle' in Python turtle"

There is a syntax error. Change the ...READ MORE

answered Jul 8, 2019 in Python by Pallavi
2,002 views
0 votes
1 answer
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 633 views
0 votes
0 answers
+4 votes
6 answers
0 votes
1 answer

Python error "AttributeError: '_Screen' object has no attribute 'mainloop'" python module turtle

Hey @Nagya, replace  wn.mainlopp() with turtle.mainloop() a ...READ MORE

answered Jun 19, 2019 in Python by Faiza
529 views
0 votes
1 answer

Python error "AttributeError: 'str' object has no attribute 'casefold'"

Check your python version. Casefold is possible ...READ MORE

answered Jul 4, 2019 in Python by Yesha
1,721 views