How are arguments passed by value or by reference in Python?
Answer Posted / nashiinformaticssolutions
In Python, arguments are passed by assignment, meaning that the reference to an object is passed to the function. Immutable types (like integers, strings, tuples) behave like "pass-by-value" because their content cannot be modified, while mutable types (like lists, dictionaries) behave like "pass-by-reference" because their content can be modified.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain between deep and shallow copy?
What is the difference between = and == in python?
What happens if an error occurs that is not handled in the except block?
How does Python handle the memory management?
How to make any variable private in python ?
How do I share global variables across modules?
What is python distutils?
What is sphinx python?
Does python do until loop?
What are the rules for legal python names?
Can we use angularjs with python?
Why is python good for machine learning?
How to convert bytes to a string?
Tell me how does python handle the memory management?
What is docstring? How to define it?