Is Python call by value or call by reference?

Video is ready, Click Here to View ×


How are parameters passed to functions in Python?

More awesome topics covered here:
Introduction to Numpy:
Introduction to Matplotlib:
Introduction to Pandas:
Intermediate Python:
Functional Programming in Python:
Python Package Publishing:
Multithreading in Python:
Multiprocessing in Python:
Parallel Programming in…

7 Comments

  1. So by the logic you explained, shouldn't a in the first example also return 2 instead of 1? Since a is the same object and you're just incrementing it by 1, or is that interpreted as a different assignment?

Leave a Reply

Your email address will not be published.


*