Overview
Questions
Practice your python.
Objectives
Work on some python exercises to continue building your skills.
The key to building your skills as a programmer is practice. Try giving yourself challenges to use the Python tools we have learned in class. Here are some exercises for you to work through to continue working on becoming a Pythonista.
x = list(range(1,20))
. This will make a list of numbers from 1 to 20. Now try the following with this list:
x[1]
.for
loop to print each value, one at a time.d1 = {'a': 10, 'b': 20, 'c': 30}
d1 = {'d': 40, 'e': 50}
d1 = {'f': 60, 'g': 70, 'h': 80}
my_dictionary
my_dictionary
has the key i
.d
to 40.4
norm_rvs
.x
crated in the very first exercise.norm_rvs
and returns a list where each element is the log(norm_rvs[i])
.norm_rvs
and the log-transformed values.surveys_df = pd.read_csv("surveys.csv")
surveys1997
containing only the observations from the year 1997.for
loop to iterate over surveys1997
and print the plot number to screen.Key Points
Practice makes Python.