Error wn trtl Screen AttributeError Turtle object has no attribute Screen

0 votes
I am trying to code a python game (very inexperienced coder here) and am following instructions for the code. It is set up as the following currently:

#-----import statements-----
import turtle as trtl

#-----game configuration----
trtl_color = "red"
trtl_shape = "circle"
trtl_size = "2"

#-----initialize turtle-----
trtl = trtl.Turtle()
trtl.shape(trtl_shape)
trtl.color(trtl_color)
trtl.pensize(trtl_size)

#-----game functions--------

#-----events----------------
wn = trtl.Screen()
wn.mainloop()

It gives me the error mentioned in the title and I have no idea how to fix it. May someone please help?
Nov 3, 2020 in Python by anonymous
• 120 points

edited Nov 3, 2020 by Gitika 617 views

1 answer to this question.

0 votes

Hi, @There,

It requires a very simple hack to get over this error. Python is case sensitive.

Replace

wn = trtl.Screen()

with the following:

wn = trtl.screen()

I hope the trick will help you!! Let me know if it worked.!! 



answered Nov 3, 2020 by Gitika
• 65,930 points

Related Questions In Python

0 votes
1 answer

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

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

answered Jun 19, 2019 in Python by Faiza
3,181 views
+1 vote
2 answers

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

Hey @Nagya, replace python.Shape("Square") with the following: python.shape("square") Python is case ...READ MORE

answered Jun 19, 2019 in Python by Faiza
14,849 views
0 votes
2 answers

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

Try this: data=pd.read_csv('/your file name', delim_whitespace=Tru ...READ MORE

answered Dec 10, 2020 in Python by anonymous
• 82,780 points
74,142 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
3,787 views
0 votes
2 answers
+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 2,259 views
0 votes
0 answers
0 votes
1 answer
0 votes
1 answer

Getting error "AttributeError: 'Screen' object has no attribute 'title' on line 8"

Hey @TedTickles,  Replace  wn.update() with turtle.up ...READ MORE

answered Dec 24, 2020 in Python by Gitika
• 65,930 points
527 views