Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Functional Python!
You have completed Functional Python!
Preview
No set of rules is complete without a list of anti-patterns and gotchas.
global and nonlocal let you work with variables from a higher scope. You should have a really good reason before using either of these!
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Let's go to WorkSpaces and
look at some things not to do.
0:00
So to illustrate some of
the things that are bad ideas,
0:02
things we shouldn't really do when we
use Python, I've got a file here called
0:06
bad examples.py, and we're gonna walk
through what each of these things are.
0:11
So up at the top, we have this
list that's a very important list.
0:16
It needs to stay exactly that way it is.
0:21
Maybe these are the order that players
signed up, or any number of things.
0:23
So it needs to stay in the order of five,
two, three, one whenever I use it,
0:29
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up