# Python Variables and Data Types (Multiple Choice Questions) MCQ – Python Interview objective questions| Python Quiz

1. x ← 25
2. x = 25
3. x := 25
4. int x = 25
5. x << 25

## 02. In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

1. False
2. True

Explanation: Variables are not statically typed in Python, as they are in some other programming languages.

## 03. Which one of the following is the correct way of declaring and initializing a variable, x with the value 7?

1. int x
x=7
2. int x=7
3. x=7
4. declare x=7

Explanation: The correct way of declaring and initializing a variable, x with the value 7 is x=7.

## 04. What will be the output of statement 2**2**2**2

1. 16
2. 256
3. 32768
4. 65536

Explanation: The statement is equivalent to 2^16. So, Option D is correct.

## 05. Which of the following statement is False?

1. Variable names can be arbitrarily long.
2. They can contain both letters and numbers.
3. Variable name can begin with underscore.
4. Variable name can begin with number.

Explanation: Variable name can not begin with the number, it can only begin with a letter or underscore.

## 06. What is the output of the following code: print 9//2

1. 4
2. 4.5
3. 4.0
4. Error

Explanation: Floor Division operator “//” – The division of operands where the result is the quotient in which the digits after the decimal point are removed. So in this case we get 4 as the answer. So, Option A is correct.

## 07. Which of the following is not a valid variable name in Python?

1. _var
2. var_name
3. var11
4. 5var

Explanation: 5var is not a valid variable name in python.

## 08. What is the maximum length of an identifier in python?

1. 32
2. 31
3. 63
4. None of the above

Explanation: In python, the Identifier can be of any length. So, Option D is correct.

## 09. Which of the following declarations is incorrect?

1. None Of the below
2. _x = 2
3. __x = 3
4. __xyz__ = 5