Geek Culture
Published in

Geek Culture

Difference Between += and + for Python List

Do you think += and + are the same?

As a Python programmer, you probably use Python list on a daily basis, but can you explain the output of the following code snippet?

l1 = [1, 2, 3]
l2 = l1
l1 += [4]
l1 = l1 +[5]




A new tech publication by Start it up (

Recommended from Medium

Time Machine Backups Too slow

UNIWA 2021 CTF: Fast Calculator Writeup

K8s — Control Pod Location

Giày da cá sấu Crox Leather lace-up Shoes

Google playstore Errors & Solutions on Sony Xperia XA1

Can't Install App Sony Xperia

QSTN: Taking control of consumer data in Web 3.0

How a Software Engineer Cooks

Build a full-stack website using Flask

flask logo

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Senior Cloud Engineer

More from Medium

10 Useful Python Programming Tips (Part 1)

Python Iterator and Generator Internals

Python Basics: Dictionaries and Sets

Python Anonymous/Lambda Functions