Skip to content

Commit 908627a

Browse files
authored
01-intro.md: Improve the explanatory text in the "Variables as Sticky Notes" callout of Episode 1 (#928)
As discussed in #847, the example in this callout makes it sound like the reason that variables don't "remember" where their values come from is a consequence of the fact that variables behave like sticky notes. However, this is inaccurate and could mislead learners. For the moment, some modification of the explanatory text has been suggested as a stop-gap until a better example can be crafted.
1 parent 2cf7c87 commit 908627a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

_episodes/01-intro.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ weight in kilograms is now: 65.0
136136

137137
> ## Variables as Sticky Notes
138138
>
139-
> A variable is analogous to a sticky note with a name written on it:
139+
> A variable in Python is analogous to a sticky note with a name written on it:
140140
> assigning a value to a variable is like putting that sticky note on a particular value.
141141
>
142142
> ![Value of 65.0 with weight_kg label stuck on it](../fig/python-sticky-note-variables-01.svg)
143143
>
144-
> This means that assigning a value to one variable does **not** change
145-
> values of other variables.
146-
> For example, let's store the subject's weight in pounds in its own variable:
144+
> Using this analogy, we can investigate how assigning a value to one variable
145+
> does **not** change values of other, seemingly related, variables. For
146+
> example, let's store the subject's weight in pounds in its own variable:
147147
>
148148
> ~~~
149149
> # There are 2.2 pounds per kilogram
@@ -160,6 +160,11 @@ weight in kilograms is now: 65.0
160160
> ![Value of 65.0 with weight_kg label stuck on it, and value of 143.0 with weight_lb label
161161
stuck on it](../fig/python-sticky-note-variables-02.svg)
162162
>
163+
> Similar to above, the expression `2.2 * weight_kg` is evaluated to `143.0`,
164+
> and then this value is assigned to the variable `weight_lb` (i.e. the sticky
165+
> note `weight_lb` is placed on `143.0`). At this point, each variable is
166+
> "stuck" to completely distinct and unrelated values.
167+
>
163168
> Let's now change `weight_kg`:
164169
>
165170
> ~~~

0 commit comments

Comments
 (0)