Computer Science
Which value is assigned to keys, if no value is specified with the fromkeys() method ?
- 0
- 1
- None
- any of these
Python Dictionaries
3 Likes
Answer
None
Reason — If no value is specified, the keys are assigned None as their default values.
Answered By
1 Like
Related Questions
Which of the following will add a key to the dictionary only if it does not already exist in the dictionary ?
- fromkeys( )
- update( )
- setdefault( )
- all of these
Which of the following will create a dictionary with given keys and a common value ?
- fromkeys( )
- update( )
- setdefault( )
- all of these
Which of the following can be used to delete item(s) from a dictionary?
- del statement
- pop( )
- popitem( )
- all of these
Which of the following will raise an error if the given key is not found in the dictionary ?
- del statement
- pop( )
- popitem()
- all of these