Quotes help make search much faster. Example: "Practice Makes Perfect"

Saturday, December 1, 2012

Codecademy: The 'in' operator


#sample solution


my_dict = {
    "Name": "Guido",
    "Age": 56,
    "BDFL": True
}

for key in my_dict:
print key

for key in my_dict:
print str(my_dict[key])

#Note: there was a requirement to put a single space between 'key' and 'value' so
#for key in my_dict:
# print key+" "+str(my_dict[key])
#should have worked

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts