Homework: Fun with Data Types
Name: ___________________
Date: ___________________
---
Part 1: Identify the Data Type
For each of the following, write whether it is an int, float, string (str), or boolean (bool).
1. 25 -> _______
2. 3.14 -> _______
3. "Hello World" -> _______
4. True -> _______
5. "10" -> _______
6. 0 -> _______
7. False -> _______
8. 7.5 -> _______
---
Part 2: Check Using Python
Write Python code to check the type of these variables using type().
Example:
# age = 10
# print(type(age))
a=8
b = 2.5
c = "Python"
d = False
---
Part 3: Create Your Own
1. Write one number without decimals and check its type.
2. Write one number with decimals and check its type.
3. Write one text (string) and check its type.
4. Write one True/False value and check its type.
---
Part 4: Bonus Fun Question
Can the number 10 and the text "10" be the same? Why or why not?