Looks neat, right? But letβs slow down.
The
The starred variable always gets a list, and it can be empty so plan accordingly when unpacking, especially in function arguments or loops.
For example: Consider the following code
No error, but
The
*b
syntax is called extended iterable unpacking. It grabs everything in the middle of the list, leaving the first item (a) and the last (c) outside the star. This pattern is super handy, but can also behave unexpectedly if you assume itβll grab just one item or not consider the structure of the data.The starred variable always gets a list, and it can be empty so plan accordingly when unpacking, especially in function arguments or loops.
For example: Consider the following code
x, *y = [42]
print(y) # []
No error, but
y
is just an empty list! Unpacking doesnβt always fill every name the way you might guess.β€1π1
Given the above Python code, what will be printed?
Anonymous Quiz
14%
"hello"
70%
"olleh"
10%
"" (empty string)
7%
Error
β€2
140+ Python Practice Programs - For Real Learning, Not Just Theory
Struggling with Python logic?
Here's over 140 real Python programs that will help you to understand how code actually works-beyond the tutorials.
From basics to interview-level logic:
Arithmetic & conversions
Loops, Recursion, Lists, Arrays
Prime, Fibonacci, Armstrong logic
Matrices, Sorting, Factorials & more
Python pdf
Struggling with Python logic?
Here's over 140 real Python programs that will help you to understand how code actually works-beyond the tutorials.
From basics to interview-level logic:
Arithmetic & conversions
Loops, Recursion, Lists, Arrays
Prime, Fibonacci, Armstrong logic
Matrices, Sorting, Factorials & more
Python pdf
β€5π1
π Free & Relevant Books for Data Science (2025) π
Want to sharpen your Python & DS skills without outdated material? Here are some modern, still-relevant free books π
1οΈβ£ Python Data Science Handbook β Jake VanderPlas
π https://jakevdp.github.io/PythonDataScienceHandbook
Core libs: NumPy, Pandas, Matplotlib, Scikit-Learn. Updated + interactive notebooks.
2οΈβ£ Python for Data Analysis (3rd Ed.) β Wes McKinney
π https://github.com/wesm/pydata-book
By the creator of Pandas. Modern data wrangling & cleaning.
3οΈβ£ Dive into Deep Learning (D2L.ai)
π https://d2l.ai
Hands-on deep learning with PyTorch & TensorFlow. University-level, interactive.
4οΈβ£ Minimalist Data Wrangling with Python (2023) β Marek Gagolewski
π https://arxiv.org/abs/2211.04630
Practical workflows for real-world messy data.
5οΈβ£ Machine Learning with PyTorch & Scikit-Learn β Raschka et al.
π https://github.com/rasbt/machine-learning-book
End-to-end ML with clean, modern Python code.
β¨ Start with VanderPlas & McKinney for core skills, then move to Raschka/D2L for ML.
Want to sharpen your Python & DS skills without outdated material? Here are some modern, still-relevant free books π
1οΈβ£ Python Data Science Handbook β Jake VanderPlas
π https://jakevdp.github.io/PythonDataScienceHandbook
Core libs: NumPy, Pandas, Matplotlib, Scikit-Learn. Updated + interactive notebooks.
2οΈβ£ Python for Data Analysis (3rd Ed.) β Wes McKinney
π https://github.com/wesm/pydata-book
By the creator of Pandas. Modern data wrangling & cleaning.
3οΈβ£ Dive into Deep Learning (D2L.ai)
π https://d2l.ai
Hands-on deep learning with PyTorch & TensorFlow. University-level, interactive.
4οΈβ£ Minimalist Data Wrangling with Python (2023) β Marek Gagolewski
π https://arxiv.org/abs/2211.04630
Practical workflows for real-world messy data.
5οΈβ£ Machine Learning with PyTorch & Scikit-Learn β Raschka et al.
π https://github.com/rasbt/machine-learning-book
End-to-end ML with clean, modern Python code.
β¨ Start with VanderPlas & McKinney for core skills, then move to Raschka/D2L for ML.
jakevdp.github.io
Python Data Science Handbook | Python Data Science Handbook
β€3