Question: Question 51 pts The items() method returns a view object containing all of the values in a dictionary list object containing all of the values
Question 51 pts
The items() method returns a
| view object containing all of the values in a dictionary |
| list object containing all of the values in a dictionary |
| view object containing all of the key/value pairs in a dictionary |
| list object containing all of the key/value pairs in a dictionary |
Flag this Question
Question 61 pts
The key in a dictionary can be
| a string |
| a number |
| a list |
| any immutable type |
Flag this Question
Question 71 pts
The keys() method returns a
| view object containing all of the keys in a dictionary |
| list object containing all of the keys in a dictionary |
| view object containing all of the key/value pairs in a dictionary |
| list object containing all of the key/value pairs in a dictionary |
Flag this Question
Question 81 pts
To avoid a KeyError when using the pop() method of a dictionary, you can
| use the optional second argument to supply the correct key |
| use the optional second argument to supply a default value |
| use the exists keyword to check whether the key exists before you call the pop() method |
| use the del keyword to check whether the pop() method can delete the key without a KeyError |
Flag this Question
Question 91 pts
To convert a view object to a list, you can use the
| list() constructor |
| dict() constructor |
| convert() method |
| items() method |
Flag this Question
Question 101 pts
To delete all items from a dictionary you can
| use the pop() method without any arguments |
| use the clear() method |
| use the deleteAll() method |
| use the del keyword on a dictionary item |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
