Oct 25, 2024
int
, float
, bool
a
is passed as parameter x
.x
inside the function don't change a
.a
retains its original value.a
is initialized to 2
.add5
function is called:
add5
, x
is modified by adding 5
.x
, which shows 7
(inside function scope).add5
returns, printing a
shows it is still 2
.b
is created with [2]
at index 0
.change
function is called:
change
, the list element at index 0
is modified to 10
.[10]
(inside function scope).change
returns, printing b
shows [10]
.