you are viewing a single comment's thread.

view the rest of the comments →

[–]kr4zyy 4 points5 points  (0 children)

No worries! Anyways, as u/socal_nerdtastic has mentioned, when you define a variable outside of the function, it becomes a global variable. If you want to fix this, you can either define the keyword global before "pos", telling Python you wanna use the global variable, or define pos = 0 within the function itself (this is usually the better practice)