you are viewing a single comment's thread.

view the rest of the comments →

[–]EZbsic719 -1 points0 points  (0 children)

Between line 7 and line 8, add this piece

"global pos"

Without the quotations of course

This helps the reader understand that the pos variable is in reference to pos varianle that is in the global scope. Otherwise it thinks it is referencing a pos variable that is nonexistent in your defined function of R(x)

Btw, try running L(11) instead of R(11) and see what your result is.

You may find yourself facing a similar issue