getting started

Variables and Data Types

In this chapter, we'll explore the fundamental building blocks of programming: variables and data types.

Understanding Variables

Variables are containers for storing data values. Think of them as labeled boxes where you can store different types of information.

Common Data Types

  1. Numbers

    • Integers (whole numbers)
    • Floating-point (decimal numbers)
  2. Strings

    • Text and characters
    • How to manipulate strings
  3. Booleans

    • True/False values
    • Logical operations

Code Examples

# Number variables
age = 25
height = 1.75

# String variables
name = "John Doe"
greeting = "Hello, World!"

# Boolean variables
is_student = True
has_experience = False

Practice working with these basic data types as they form the foundation of programming!