Python Data Types & Basic Operations Quiz
1. Which data type stores whole numbers?
float
str
int
bool
2. Which data type stores decimal numbers?
int
float
str
bool
3. What is the data type of "Hello"?
int
float
str
bool
4. Which value is a boolean?
"True"
true
True
1
5. What will this code output?
print(5 + 3)
53
8
15
Error
6. What will this code output?
print("5" + "3")
8
53
Error
15
7. Which operator is used for multiplication?
+
-
*
/
8. What does // do in Python?
Regular division
Modulus
Floor division
Exponent
9. What is the result of 10 % 3?
3
1
0
10
10. Which operator is used for exponentiation?
^
**
exp
//
11. What will this code output?
print(type(10))
<class 'float'>
<class 'str'>
<class 'int'>
int
12. Which converts a number to a string?
int()
float()
str()
bool()
13. What will this code output?
print(7 / 2)
3
3.5
4
Error
14. What will this code output?
print(7 // 2)
3
3.5
4
Error
15. What will this code output?
print("Hi" * 3)
Hi3
HiHiHi
Error
Hi Hi Hi
16. Which of the following is NOT a valid data type?
int
float
string
bool
17. What is the result of True + True?
True
2
Error
False
18. Which comparison operator checks equality?
=
==
!=
<=
19. What is the result of 5 > 3?
8
True
False
Error
20. Which function shows the data type of a value?
datatype()
type()
typeof()
class()
Submit Quiz