This course will be retired on June 22, 2018. We recommend "Python Basics" for up-to-date content.
Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Shopping List Takeaways1:22 with Kenneth Love
Here's what I picked up from doing the shopping list project with you.
Our app was really simple but we build a concrete example of several concepts:
- user input
Our shopping list script might be better suited for
making just any old list, not necessarily a shopping list.
While the script might be simple, it touched on several important things.
By using the mutable shopping list variable out in the global scope, or
the outermost part of the script, we were able to update and
access it in all of the other parts of our script.
This isn't always the best design, but it works well for this kind of app.
Since we put our help text into a function that runs on demand,
we can easily tell users about new functionality that we add.
We only have to update the one function to tell them about neat
new abilities in the script.
We can also now easily let them see the help text any time that they need it.
And even though it might not seem like it, our add to list function,
which just adds an item into our list and prints a message gives us a great hook for
We can use the simple function to change how things get added to our list or
what happens after things are added.
Maybe we want to update a database or
send a notification off to some other application.
Even though that application was simple we picked up a lot from it.
And if nothing else we now have a fully functioning Python application
that we've written.
The next stage's program is a little more complicated so
be sure to take a little break before you start on it.
Your brain needs some time to process and
absorb all the stuff we've done and I need some time to get ready for you.
You need to sign up for Treehouse in order to download course files.Sign up