Monday, August 11, 2014

Day 128

Python at CodeCademy. Worked on Python tutorial 10 of 14, Python Lists and Dictionaries: This Next Part is Key! Worked on dictionary and accessing values by looking up a key.

The code used:
residents = {'Puffin' : 104, 'Sloth' : 105, 'Burmese Python' : 106}

print residents['Puffin'] # Prints Puffin's room number
print residents['Sloth']
print residents['Burmese Python']

The interaction for this code:
104
105
106

No comments:

Post a Comment