Read Allen Downey's Think Python for getting up to speed with Python 2.7 and computer science topics. It's completely available online, or you can buy a physical copy if you would like.
For quick and easy interactive practice with Python, many people enjoy Codecademy's Python track. There's also Learn Python The Hard Way and The Python Tutorial.
How are Python lists and tuples similar and different? Which will work as keys in dictionaries? Why?
REPLACE THIS TEXT WITH YOUR RESPONSE
How are Python lists and sets similar and different? Give examples of using both. How does performance compare between lists and sets for finding an element. Why?
REPLACE THIS TEXT WITH YOUR RESPONSE
Describe Python's lambda
. What is it, and what is it used for? Give at least one example, including an example of using a lambda
in the key
argument to sorted
.
REPLACE THIS TEXT WITH YOUR RESPONSE
Explain list comprehensions. Give examples and show equivalents with map
and filter
. How do their capabilities compare? Also demonstrate set comprehensions and dictionary comprehensions.
REPLACE THIS TEXT WITH YOUR RESPONSE
Use Python to compute days between start and stop date.
a.
date_start = '01-02-2013'
date_stop = '07-28-2015'
REPLACE THIS TEXT WITH YOUR RESPONSE (answer will be in number of days)
b.
date_start = '12312013'
date_stop = '05282015'
REPLACE THIS TEXT WITH YOUR RESPONSE (answer will be in number of days)
c.
date_start = '15-Jan-1994'
date_stop = '14-Jul-2015'
REPLACE THIS TEXT WITH YOUR RESPONSE (answer will be in number of days)
Place code in this file: q5_datetime.py
Edit the 7 functions in q6_strings.py
Edit the 5 functions in q7_lists.py
Write a script as indicated (using the football data) in q8_parsing.py