The "In" Operator


#1

My code works but it does not print out entire library or at least true components. Why?

my_dict = {
"Name": "Jinx",
"Age": 25,
"BDFL": True,

"Name": "Lux",
"Age": 30,
"BDLF": False,

"Name": "Sivir",
"Age": 45,
"BDLF": True

}

for key in my_dict:
print key, my_dict[key]


#2

Key names of a dictionary are a set, meaning they do not repeat. Each of the above need to be in their own dictionary.

my_dict = {
    jinx: {

    },
    lux: {

    },
    sivir: {

    }
}

#3

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