Common mistakes we make in Python and why we should avoid that part 2

>>> a = [1, 2, 3] 
>>> b = [1, 2, 3]
>>> a == b True
>>> a is b False
>>> id(a) 140281424436160
>>> id(b) 140281424966208
>>> a = [1,2,3]
>>> b = a
>>> a == b True
>>> a is b True
>>> id(a) 140281424966208
>>> id(b) 140281424966208
>>>

--

--

--

Coding, Reading,Python

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

TryHackMe — Tartarus CTF Writeup (Detailed)

21. Let’s Be Friends. The Year of Paying Attention

Well, here’s another nice mesh you’ve gotten me into

Task Management Software: Its Best Examples in 2018

Finishing an Eminem fan app in a weekend using GraphQL and Expo

Current Bloc Student, Nadine Zahr, Conquers UX Design

Interrogating machine generated data for diagnostics

5 Basic SQL Commands You Need To Know As A Beginner

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
Afsalms

Afsalms

Coding, Reading,Python

More from Medium

Statement Control by Python

Operators in Python

Dictionaries in Python

How Python Evolved as a Programming Language