Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Altering Data #

Sumit Rawal answered on May 16, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers


Altering Data #

0

When mutable data is passed to a function, the function can modify or alter it. These modifications will stay in effect outside the function scope as well. An example of mutable data is a list.

In the case of immutable data, the function can modify it, but the data will remain unchanged outside the function’s scope. Examples of immutable data are numbers, strings, etc.

Let’s try to change the value of an integer inside a function:

Popularity 1/10 Helpfulness 1/10 Language python
Source: Grepper
Tags: python
Link to this answer
Share Copy Link
Contributed on May 16 2023
Sumit Rawal
0 Answers  Avg Quality 2/10


X

Continue with Google

By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
X
Grepper Account Login Required

Oops, You will need to install Grepper and log-in to perform this action.