Python Variables and Data Types
Python Variables and Data Types - Important Points
| 1. | Which of the following is a valid data type in Python? |
|---|
A. Integer
B. Real
C. Complex
D. All of the above
View Answer Discuss Work SpaceAnswer: option d
Explanation:
Python supports several data types, including integers, floating-point numbers, complex numbers, and others.
| 2. | What is the result of the expression 4 + 5.0 in Python? |
|---|
A. 9
B. 9
C. Error
D. None of the above
View Answer Discuss Work SpaceAnswer: option b
Explanation:
| 3. | Which of the following is not a valid variable name in Python? |
|---|
A. my_variable
B. 123variable
C. _my_variable
D. myVariable
View Answer Discuss Work SpaceAnswer: option b
Explanation:
| 4. | Which of the following is a valid way to assign a value to a variable in Python? |
|---|
A. x = 5
B. 5 = x
C. x + 5
D. 5 + x
View Answer Discuss Work SpaceAnswer: option a
Explanation:
| 5. | What is the result of the expression "Hello" + "World" in Python? |
|---|
A. HelloWorld
B. Hello World
C. Hello+"World"
D. None of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation: