1. What is a variable in programming?
Explanation: A variable is a storage location in programming that holds data, and its value can change during program execution.
Which of the following is NOT a data type?
Explanation: A variable is not a data type but a storage unit. Common data types include String, Integer, Float, and Boolean.
What type of data is stored in a String?
Explanation: A string is a collection of characters (letters, numbers, and special symbols) enclosed in quotes.
Which of the following is an example of an Integer?
Explanation: Integers are whole numbers without decimal points. 100 is an integer, whereas 24.5 is a float.
5. What is the Boolean value of True in Python?
Explanation: In Python, True represents 1, and False represents 0.
6. What is the purpose of the assignment operator = in Python?
Explanation: The = operator is used to assign a value to a variable, such as age = 10.
7. What will be the output of the following Python code?x = 10y = 2.5print(type(y))
Explanation: Since y holds a decimal number (2.5), Python automatically assigns it the Float data type.
8. Which of the following is NOT a valid Boolean value?
Explanation: Booleans in Python only take True and False (capitalized). Other representations like 0 and 1 work, but "Yes" is a string, not a Boolean.
9. What is the correct way to define a String in Python?
Explanation: In Python, strings can be enclosed in single ('), double ("), or triple (''') quotes.
10. What type of value will the following statement store in the variable?number = "123"
Explanation: Even though "123" contains digits, it is enclosed in quotes, making it a String.