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: RootMe by ReddyyZ

#100DaysOfCode Day 17: POST Request, Tweet from Home (Part 2 of Developing a Twitter Client)

The utility of Data Structure

Building your own quadcopter! (S500 Frame + APM 2.8)

Top programming languages trends ​​in 2020 : which one you should learn

What is the difference between frontend and backend development?

Become the software developer your clients love with Zero Configuration

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

Turning objects lazy in Python

Building a Store in Python

Functions vs Methods

Make it easier to customize Matplotlib style with your own Python module