for x in range (360):
The above code is problem.when I try to run.I don’t understand. Please help
Thank you for reply sir.but I can’t understand your language
I see two problems:
- You define
coloursand then reference
colors. One of those must be a typo.
turtle.pen()does not return an object. I assume you mean the
Turtle(which has capital
Penas an alias). You should use
t = turtle.Turtle()instead.
When asking about code problems in the future please describe exactly what is going on, not just “problem”, and any error messages you’re getting. It’s much easier to help that way.
That’s impossible to answer without seeing your code, but the error message should tell you the affected line.
There’s a basic description of indentation rules here (third point in section 3.2):
Please check my codes
That message says that
turtle.Pen is not a valid name. So whatever you use is not compatible with regular Python. Maybe an outdated version?
turtle.Turtle instead, as I mentioned above the
Pen is simply an alias for that. If that doesn’t help you’ll need to look into getting a current Python version, or find documentation on whatever variant you’re using to see how they modified the API.
I try everything but not working in "qpython "app.Attribute issue.I am non programming background student
qpython is likely to be your problem. Try using “python” or “python3” instead. I doubt the “turtle” library is available in qpython.
You need to type the real program, letter by letter. For instance your copy is missing the spaces at the beginning of lines 7 through 10.