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
How do you handle exceptions with try/except/finally in python?
What’s the difference between a for loop and a while loop?
Which database is best with python?
What are accessors, mutators, and @property?
Explain how can you access a module written in python from c?
What is sphinx linux?
What kinds of patterns could I enforce on the code to make it easier to translate to another programming language?
Are there any interfaces to database packages in python?
Explain about assert statement?
Write program to validate the email address in python?
Explain python is one line?
How can you handle multiple exception in python?
What is a docstring in python?
What does kwargs mean?
How do you implement json given that python is best suited for the server-side application?