What a function can change
Watch it run · 1 of 3
A number vs a list
1def add_one(x):2 x = x + 134def add_item(items):5 items.append(1)67n = 58add_one(n)9nums = [7]10add_item(nums)11print(n, nums)
Memory
int n
5
Output
(nothing yet)line 7n is 5.
step 1 of 5