So, I am very new to coding, a while back I bought a Python coding bundle off of Humble Bundle, and have just recently actually gotten to try and actually code, but I have hit a bit of a snag, I started off with the book 'Teach your kids to code', as I have no previous coding experience it seemed like a good place to start, I have followed the instructions put forth in the book, but I keep getting the same error message, I have tried mess around a bit with the code, with no luck, I have gone online, and tried to Google it, some things did pop up, but I couldn't get the connection between the other person's problem, and my own, so now I am asking here, and I hope that someone can help me. I will post pictures showing what the book puts forth, what I have typed in, and what message I get.
Thanks in advance
Jonas P.
![[Image: view?usp=sharing]](https://drive.google.com/file/d/1OnTeY0hJD0jbGqEVB7jUXtRw0o_TqxlZ/view?usp=sharing)
Please post your actual code in code tags (use the python icon when posting). Pictures of code don't help us much as we then have to type the whole thing out ourselves.
(Jan-30-2018, 05:48 PM)Mekire Wrote: [ -> ]Please post your actual code in code tags (use the python icon when posting). Pictures of code don't help us much as we then have to type the whole thing out ourselves.
Sorry.
import turtle
t = turtle.pen()
turtle.bgcolor('black')
colors = ['yellow', 'green', 'blue', 'red']
for x in range(100):
t.pencolor(colors[x%4])
t.forward(x)
t.left(91)
Hopefully this helps. As I said, I am new to coding, and even more so to this forum.
Sorry again.
Sincerely
Jonas P.
check line #2. In the example it's t=turtle.Pen()
, note the capital P
(Jan-30-2018, 06:49 PM)buran Wrote: [ -> ]check line #2. In the example it's t=turtle.Pen()
, note the capital P
Thank you! This problem have been bugging me quite a bit, I feel really silly for not noticing that I only needed to change the p. Thank you very much, again.
Hope that you have a great day.
Sincerely
Jonas P.
Which IDE are you using. Code completion would help. I use PyCharm, a very professional and complete interactive development environment.