Python 3D Academyবাংলা

Variables & Data Types in Python

Chapter 2: Variables & Data Types

4 short lessons, with 3D animations, quizzes and coding tasks.

The lessons

  1. What is a variable?

    A variable is a name that holds a value, so you can store the value once and use it by name as often as you like.

  2. Naming rules and changing values

    A variable's name must follow Python's naming rules, and giving it a new value replaces the old one.

  3. Data types: int, float, str and bool

    Every value has a type, and the type decides what Python can do with it.

  4. Multiple assignment and swapping

    Python can fill several names in one line, matching the names on the left to the values on the right in order, and a, b = b, a uses this to swap two values safely.