---
title: "how arguments are passed by value or by reference ?"  
description: "how arguments are passed by value or by reference ?"  
author: "Prakash nidhi Verma"  
published: 2018-07-20  
updated: 2020-09-15  
canonical: https://www.mindstick.com/interview/23477/how-arguments-are-passed-by-value-or-by-reference  
category: "python"  
tags: ["python"]  
reading_time: 1 minute  

---

# how arguments are passed by value or by reference ?

An object oriented language which that all variables hold references to their objects in Python. The references values execute are according to the given functions and as a following result the value of references can't be changed. and the objects can be changed if it is mutable.

```
def function(my_dict):     my_dict["a"] = 1
d = {}
function(d)
print d
# {'a': 1}
```

## Answers

### Answer by Anonymous User

Post is removed by the Admin.

### Answer by Prakash nidhi Verma

An object oriented language which that all variables hold references to their objects in Python. The references values execute are according to the given functions and as a following result the value of references can't be changed. and the objects can be changed if it is mutable.

```
def function(my_dict):     my_dict["a"] = 1
d = {}
function(d)
print d
# {'a': 1}
```


---

Original Source: https://www.mindstick.com/interview/23477/how-arguments-are-passed-by-value-or-by-reference

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
