Code viewer for World: Type Checking with type()
"""
Topic: Type Checking with type()
Purpose: Learn how to check the type of a variable
Output: Displays the value of a variable and its type in the terminal
"""

# -----------------------------
# 1. What is type checking?
# -----------------------------
# Every variable in Python has a type. The type tells Python what kind of data it is.
# Common types: int (whole numbers), float (decimal numbers), str (text), bool (True/False)

# -----------------------------
# 2. Example variables
# -----------------------------
age = 10               # Integer
height = 4.5           # Float
name = "Aaqid"         # String
is_student = True      # Boolean

# -----------------------------
# 3. Checking types using type()
# -----------------------------
print("Value:", age, "Type:", type(age))           # <class 'int'>
print("Value:", height, "Type:", type(height))     # <class 'float'>
print("Value:", name, "Type:", type(name))         # <class 'str'>
print("Value:", is_student, "Type:", type(is_student)) # <class 'bool'>

# -----------------------------
# 4. Notes
# -----------------------------
# 1. type() is a function that tells you the type of a variable.
# 2. Knowing the type helps you understand what you can do with a variable.
# 3. Python figures out the type automatically when you assign a value.