I am currently learning Python out of a book, gearing up for classes starting in January. I wanted to get a jump start on some programming just to get my feet wet, and to see how things work. I am using the book called "Python Programming for the absolute beginner" 3rd edition. I downloaded python 3.1 from their companion site so I would be sure to have to version they used in the book.

Since starting, I have noticed a few quirks. For example, I wrote a program from the book that was to display the words "Game Over" written in slashes. The program worked fine for the "Game" part, but broke up the word "OVER" for some reason. After fiddling with it, I realized that the last bit of the "R" ended in \. Apparently the program didn't like it, so it messed up the whole word. I solved this by making an exclamation point at the end of the word "over", so the end of the row was | instead of \. NO big deal really, I mean how many times do you end up programming something with a slash at the end?

Now, a more annoying quirk has popped up. Apparently, there is some strange syntax problem with break statements in loops. I copied a code out of the book that was supposed to count from 0 to 10 and if count>10, the program would break and give users the option to leave the program. Well, IDLE keeps yelling at me that break is "outside of the loop". I tried random things to see if I could get this or that little change to work, shifting the line, putting the command inside parenthesis, all sorts of junk that I figured probably wouldn't work.

My husband thinks it has something to do with the AMD processor on my machine. It is a laptop with WIN8, but this also happens on my Win7 desktop. All of our machines have AMDs of various generations. Does anyone know what is up with these weird quirks? Did I snag a different version of python or is my processor messing with this stuff? I want to figure this out, cuz it is driving me nuts!

Just to reiterate, your processor should never impact your Python code, with the exception being a faulty processor. As for the operating system, most Python code is entirely unaffected by it, especially when you code correctly, like using the os module instead of trying to manipulate paths yourself (since Windows differs from Unix-like systems such as Mac OS X and Linux). There are small exception for performance as well, but don't worry about that. Also, before long, you'll intuitively know when certain things are operating system dependent and when they're not.

Hyphy wrote:Well that's what I get for trusting in a book, where non-computer editors might move things. I had a bit of "The book must be right!" tunnel vision. Thanks for helping me! I feel a bit silly! :)

Well when I look at pages 72-73 at http://www.amazon.com/Python-Programmin ... 1435455002 it looks like they have it right. Perhaps it's harder to tell when those pages are side by side instead of next to each other at top and bottom. If you want to be a programmer though, you're going to have to read something like "break outside of loop" then look at the code and see what you need to change; if you understand the role of indentation, you'd see that in your original code the break is not in the loop but could easily moved in.

Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.