Variables and Data Types in Python MCQs
Variables and Data Types in Python – MCQs
Section 5: Introduction to Programming (Python / Coding Concepts)
Topic: Variables and Data Types in Python
CBSE Board Examination Preparation – Strictly as per NCERT Syllabus
1. What is a variable in Python?
A variable is like a container that stores data values. In Python, we assign values using the = operator. Example: x = 10
2. Which symbol is used to assign value to a variable?
The equal sign (=) is called the assignment operator. It assigns a value to a variable.
3. Which of the following is an integer data type?
Integers (int) are whole numbers without decimal points. Example: 5, -3, 100
4. Which data type is used for decimal numbers?
Float data type stores decimal numbers. Example: 5.5, 3.14
5. Which data type is used for text?
String (str) data type stores text values enclosed in quotes. Example: "Hello"
6. What will type(5.0) return?
5.0 contains a decimal point, so it is a float data type.
7. True and False belong to which data type?
Boolean (bool) data type has only two values: True and False.
8. Which of the following is a valid variable name?
Variable names cannot start with numbers or special symbols and cannot be Python keywords.
20. Which function is used to check the data type of a variable?
The type() function returns the data type of a variable. Example: x = 10 print(type(x)) → <class 'int'>
