1. [“john”, “peter”]
2. [“john”:40, “peter”:45]
3. (“john”, “peter”)
4. (“john”:40, “peter”:45)
[“john”, “peter”]
1. Since “susan” is not a value in the set, Python raises a KeyError exception
2. It is executed fine and no exception is raised, and it returns None
3. Since “susan” is not a key in the set, Python raises a KeyError exception
4. Since “susan” is not a key in the set, Python raises a syntax error
Since “susan” is not a key in the set, Python raises a KeyError exception
1. The values of a dictionary can be accessed using keys
2. The keys of a dictionary can be accessed using values
3. Dictionaries aren’t ordered
4. Dictionaries are mutable
The keys of a dictionary can be accessed using values
1. {1: ‘A’, 2: ‘B’}
2. dict([[1,”A”],[2,”B”]])
3. {1,”A”,2”B”}
4. { }
{1,”A”,2”B”}
1. 1 A 2 B 3 C
2. 1 2 3
3. A B C
4. 1:”A” 2:”B” 3:”C”
1 A 2 B 3 C
1. 1
2. A
3. 4
4. Invalid syntax for get method
A
1. Error, invalid syntax
2. A
3. 5
4. 4
4
1. {1: ‘A’, 2: ‘B’, 3: ‘C’}
2. C
3. {1: 3, 2: 3, 3: 3}
4. No method called setdefault() exists for dictionary
C
1. {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’}
2. None
3. Error
4. [1,3,6,10]
{1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’}
1. {1: ‘A’, 2: ‘B’, 3: ‘C’}
2. Method update() doesn’t exist for dictionaries
3. {1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’}
4. {4: ‘D’, 5: ‘E’}
{1: ‘A’, 2: ‘B’, 3: ‘C’, 4: ‘D’, 5: ‘E’}