Lesson number one


#1



https://www.codecademy.com/courses/python-beginner-en-qzsCL/0/1?curriculum_id=4f89dab3d788890003000096

I've tried to come up with a more efficient way of creating these dictionaries. I've tried this in pycharm and it seems to create the dictionaries correctly. However, through the lesson, I am getting the follwing error. Any ideas why?


Oops, try again. The name key does not have the value "Lloyd" in your lloyd dictionary.

names = ["lloyd", "alice", "tyler"]

def create_dic(name):
    return {
        "name": name,
        "homework": [],
        "quizzes": [],
        "tests": [],
        }

for word in names:
    globals()["%s" % word] = create_dic(word)

#2

a function doesn't execute unless called, so you will need to call the function to create the dictionaries


#3

Sorry! I hadn't copied in the last line of my code.
Let me edit it now.


#4

i need more time with this problem, which i will have later today, i will come back to this


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.