-
-
Notifications
You must be signed in to change notification settings - Fork 439
Open
Labels
good first issueGood issue for first-time contributorsGood issue for first-time contributorshelp wantedLooking for ContributorsLooking for Contributorstype:enhancementPropose enhancement to the lessonPropose enhancement to the lesson
Description
In Lesson 3, it is stated that "Variables only change value when something is assigned to them" in one of the headings. That is not correct when the variables are copied by reference to another variable: When the original variable is changed, the second one changes, too.
This is easily seen with lists:
a = [1, 2, 3]
b = a
a[2] = 4
print(a)
print(b)
The output in both cases is [1, 2, 4] even though we didn't changed variable b
explicitly. This effect can be very confusing to new users, getting unexpected results when they didn't change their variables, and I think it deserves an explanation somewhere within this lesson.
I'm happy to contribute to that part if it seems like a reasonable addition.
Best wishes,
Diego
Metadata
Metadata
Assignees
Labels
good first issueGood issue for first-time contributorsGood issue for first-time contributorshelp wantedLooking for ContributorsLooking for Contributorstype:enhancementPropose enhancement to the lessonPropose enhancement to the lesson