Data Types and Variables Quiz - CBSE Class 10 Computer Science
Free practice quiz: Data Types and Variables (CBSE Class 10 Computer Science). 37 multiple-choice questions with answers and explanations. Play online, no sign-up needed.
Play all 37 questions freeSample questions
What is a variable in Python?
- A place to store a value
- A data type
- A function
- An error
Show answer
Answer: A. A place to store a value
A variable is used to store data or values in a program. In Python, a variable can hold different data types.
Which keyword is used to define a variable in Python?
- var
- let
- def
- None
Show answer
Answer: D. None
Python does not use a specific keyword to define a variable. A variable is created by assigning a value to it.
What will be the output of: bool([])?
- True
- False
- Error
- None
Show answer
Answer: B. False
In Python, empty collections (like empty lists) evaluate to False when converted to a boolean.
Which of the following statements is true about string data type in Python?
- Strings are mutable.
- Strings can store numerical values only.
- Strings are immutable.
- Strings can only use single quotes.
Show answer
Answer: C. Strings are immutable.
In Python, strings are immutable, meaning that once created, their content cannot be changed.
How are negative indexes used in Python lists?
- To access elements in reverse order
- To throw an error
- To declare null values
- To replace elements
Show answer
Answer: A. To access elements in reverse order
Negative indexes in Python lists start counting from the end of the list, allowing reverse accessing of elements.