Anonymous user
PyCon intro tutorial/Python scripts2: Difference between revisions
PyCon intro tutorial/Python scripts2 (view source)
Revision as of 15:52, 9 April 2014
, 10 years agono edit summary
imported>Jesstess No edit summary |
imported>Jesstess No edit summary |
||
Line 7:
# How do you create a new dictionary?
# How do you replace items in a dictionary?
# If you have a dictionary <code>flavors = {"Adam": "vanilla", "Jessica": "chocolate"}</code> and execute the code <code>flavors["Adam"] = "rum raisin"</code> what does <code>flavors</code> now look like?
# What are 3 examples of when using dictionaries would be a good idea?
== Step #
Time to practice looking things up! Use your favorite search engine to learn about modules. Answer these questions:
# What does <code>import random</code> do?
# After reviewing https://docs.python.org/2/library/random.html, how would you select a random item from a list?
== Step #3: Review the state capitals quizzer ==
|