Python Data Types Questions and Answers
Practice ModeShowing 10 of 24 questions
Q21
Which method removes and returns the last item from a list?
Answer: Option B
Explanation: pop() without index removes and returns the last item from a list.
Q22
What is the data type of True and False?
Answer: Option C
Explanation: True and False are boolean literals in Python.
Q23
Which creates a dictionary with keys 'a' and 'b'?
Answer: Option D
Explanation: Dictionaries are created with key-value pairs in curly braces.
Q24
What does the len() function return for "python"?
Answer: Option B
Explanation: The len() function returns the number of characters in a string.