Empty keys


#1



Student becomes a teacher 1.1


Hey Guys, I feel so dumb, but i cant get how to fill dict with empty keys with a nice way (without givin a value "None" for each one by one)
Ive already tried several ways and in seems i got stuck in even begining.


#2

the name key should have a name as value (Lloyd for example), the other keys need an empty list as value


#3

The dictionaries start with four keys, one of which is 'name' that will receive a string value, the remaining three will temporarily get an empty list ([]).

lloyd = {
    'name': "Lloyd",
    'homework': [],
    'quizzes': [],
    'tests': []
}

#4

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