Variables and Data Types
Lesson 1: Variables and Data Types
In this lesson, we’ll cover the following topics:
- What are variables?
- Basic data types: int, float, str, bool
- How to declare and assign variables
- Type conversion
Example:
# Declaring variables
age = 25
name = "John"
height = 1.75
is_student = True
# Type conversion
age_str = str(age)
height_int = int(height)
print(f"{name} is {age} years old and {height} meters tall.")
print(f"Is {name} a student? {is_student}")