Python Programming - Data Types Questions with Answers explain how Python stores and handles different types of data. These Python Data Types Questions are important for TCS, RRB, and SSC exams to strengthen programming fundamentals
Python Data Types
Showing 10 of
24 questions
Questions per page:
5
10
20
50
1. Which of the following is a mutable data type in Python?
Answer: Option
C
Hints: Lists and dictionaries are mutable, meaning their content can be changed after creation.
Show
Answer
Hide
Answer
Report
2. What is the output of: print(type([]))
<class 'str'>
<class 'list'>
<class 'tuple'>
<class 'dict'>
Answer: Option
B
Hints: The square brackets [] create a list object in Python.
Show
Answer
Hide
Answer
Report
3. Which data type would be most appropriate for storing a collection of unique items?
list
tuple
set
dictionary
Answer: Option
C
Hints: Sets in Python are unordered collections of unique elements.
Show
Answer
Hide
Answer
Report
4. What does the following code return: bool("False")
Answer: Option
B
Hints: Any non-empty string evaluates to True in boolean context.
Show
Answer
Hide
Answer
Report
5. Which of these is an immutable sequence type?
list
dictionary
set
tuple
Answer: Option
D
Hints: Tuples are immutable sequences, while lists are mutable sequences.
Show
Answer
Hide
Answer
Report
6. What is the data type of (1,)?
Answer: Option
B
Hints: A tuple with single element requires a trailing comma.
Show
Answer
Hide
Answer
Report
7. Which method would you use to get all keys from a dictionary?
get_keys()
keys()
all_keys()
dict_keys()
Answer: Option
B
Hints: The keys() method returns a view object of all keys in a dictionary.
Show
Answer
Hide
Answer
Report
8. What is the result of: 3 + 4.5
Answer: Option
B
Hints: Python automatically converts int to float when performing arithmetic with mixed types.
Show
Answer
Hide
Answer
Report
9. Which of these creates a set in Python?
Answer: Option
D
Hints: Sets are created with curly braces {} or the set() constructor.
Show
Answer
Hide
Answer
Report
10. What does None represent in Python?
0
False
Null value
Empty string
Answer: Option
C
Hints: None is a special constant representing the absence of a value or a null value.
Show
Answer
Hide
Answer
Report