Python Variables and Data Types
Python Variables and Data Types - Important Points
6. | Which of the following is a valid Boolean value in Python? |
---|
A. 1
B. 0
C. 1
D. 0
View Answer Discuss Work SpaceAnswer: option c
Explanation:
7. | What is the result of the expression 10 % 3 in Python? |
---|
A. 3.3333
B. 3
C. 1
D. 0.3333
View Answer Discuss Work SpaceAnswer: option c
Explanation:
8. | What is the data type of the variable 'age' in the following code? |
---|
A. Integer
B. String
C. Float
D. Boolean
View Answer Discuss Work SpaceAnswer: option a
Explanation:
9. | What is the output of the following code? num = 5 print(type(num)) |
---|
A. 5
B. '5'
C. int
D. str
View Answer Discuss Work SpaceAnswer: option c
Explanation:
The code assigns the integer value of 5 to the variable 'num', and then prints the data type of the variable, which is 'int'.
10. | What is the data type of the variable 'name' in the following code? |
---|
A. Integer
B. String
C. Float
D. Boolean
View Answer Discuss Work SpaceAnswer: option b
Explanation: