PyCon intro tutorial/Python scripts2: Difference between revisions

no edit summary
imported>Jesstess
(Created page with "__NOTOC__ == Step #1: learn about dictionaries == == Review the state capitals quizzer == Review a useful script synthesizes a number of useful concepts that we've covered....")
 
imported>Jesstess
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 3:
== Step #1: learn about dictionaries ==
 
Time to practice looking things up! Use your favorite search engine to learn about another useful Python container type called a dictionary. Answer these questions:
== Review the state capitals quizzer ==
 
# How do you create a new dictionary?
# How do you replace items in a dictionary?
# If you have a dictionary <pre>flavors = {"Adam": "vanilla", "Jessica": "chocolate"}</pre> and execute the code <pre>flavors["Adam"] = "rum raisin"</pre> what does <code>flavors</code> now look like?
# What are 3 examples of when using dictionaries would be a good idea?
 
== Step #2: learn about modules ==
 
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 ==
 
Review a useful script synthesizes a number of useful concepts that we've covered.
Anonymous user