Session X of the Complete Python Series covers every way you can assign a value
to a variable in Python - and there are more than you think.
Most beginners only ever use x = 5. But Python lets you assign several variables
in one line, unpack a list straight into variables, swap two values without a
temporary variable, and update a variable in place. These show up constantly in
real code, so it's worth knowing all of them properly.
⏱ TIMESTAMPS
00:00 Introduction
00:00 Simple assignment
00:00 Multiple assignment (a, b = 1, 2)
00:00 Chained assignment (a = b = c = 0)
Swapping without a temp variable
Unpacking a list or tuple
Extended unpacking with *
Ignoring values with _
Augmented assignment (+=, -=, *=, //=)
Walrus operator (:=)
Common mistakes and errors
Practice problems
Recap
📌 WHAT YOU'LL LEARN
Assigning multiple variables on a single line
Chained assignment and the catch with mutable objects
Swapping two values the Pythonic way
Unpacking sequences directly into variables
Using *rest to collect leftover values
The underscore convention for values you don't need
Augmented assignment operators and what they really do
The walrus operator and where it's actually useful
Why "too many values to unpack" happens
💡 PRACTICE
1. Swap two numbers in a single line
2. Unpack [10, 20, 30, 40, 50] into first, *middle, last
3. Set a = b = [] then append to a - print both and explain what happened
Post your answers in the comments.
⚠️ WATCH OUT
Chained assignment with lists catches almost everyone. a = b = [] does NOT give
you two separate lists. We cover exactly why in this session.
🔔 Subscribe for the next session.
#python #pythonvariables #learnpython #pythontutorial #pythonforbeginners #pythontricks #coding #programming
On this page of the site you can watch the video online Python Variable Assignment - Multiple, Chained & Unpacking | Session 3 with a duration of hours minute second in good quality, which was uploaded by the user RugvAI Labs 25 August 2026, share the link with friends and acquaintances, this video has already been watched 8 times on youtube and it was liked by 0 viewers. Enjoy your viewing!