In [ ]:
Check your answer. (Hint: it's not 5)
In [ ]:
In [ ]:
listofsillypeople =
Add two more things, say, "Izzard" and "Booth"
In [ ]:
Retrieve the "Chapman" field from listofsillypeople.
In [ ]:
In [ ]:
digitslist = [ ]
Predict the output of the following command.
In [ ]:
print digitslist[8] + digitslist[5]
In [ ]:
digitsdict = { }
Predict the output of the following command
In [ ]:
print digitsdict["nine"] + digitsdict["seven"]
How about this one?
In [ ]:
print digitsdict[digitslist[1]] + digitsdict[digitslist[2]] + digitsdict["zero"]
In [ ]:
fh = open("data.dat") # open file
for line in fh: # loop through fh one line at a time
print line.strip()