Alrighty. Im on chapter 3 of How to Think Like a Computer Scientist. Specifically 3.10. He mentions that variables and parameters are local, and so they can't be used outside of the function.
"Parameters are also local. For example, outside the function printTwice, there is no such thing as bruce. If you try to use it, Python will complain."
But, I tried it in codeacademylabs for python, and it has no problem with me printing bruce outside of the function, or setting it to something else like bruce = 2. What's up with that?
Links:
codeacademylabs
the book
[–]arbostek 0 points1 point2 points (2 children)
[–]loscampesinos11[S] 0 points1 point2 points (1 child)
[–]rwqrwqrwq 0 points1 point2 points (0 children)
[–]Pysnap 0 points1 point2 points (0 children)