Skip to content

Conversation

@alistairwalsh
Copy link
Contributor

In the challenge 'Sorting out references' multiple assignment is used without any previous mention. I have added the use of assigning multiple values to multiple variables in the numpy methods section. I understand that this is introducing two new concepts at the same time (methods and multiple assignment).

It does allow the student to chunk the three descriptive statistics though so is might lower the load on working memory
The other options are to:

  1. Introduce simultaneous assignment in it's own section, either in this lesson or move it elsewhere and move the challenge. (This lesson is already large)
  2. There is also the option of removing the multiple assignment from the challenge and assigning each variable separately. (Multiple assignment is a neat feature of Python)

In the challenge 'Sorting out references' multiple assignment is used without any previous mention. I have added the use of assigning multiple values to multiple variables in the numpy methods section. I understand that this is introducing two new concepts at the same time (methods and multiple assignment). 

It does allow the student to chunk the three descriptive statistics though so is might lower the load on working memory
The other options are to introduce simultaneous assignment in it's own section, either in this lesson or move it elsewhere and move the challenge. There is also the option of removing the multiple assignment from the challenge and assigning each variable separately.
@abostroem
Copy link
Contributor

Surprisingly (to me) I'm ok with this change, because multiple assignment is used often and we expect it for the exercise, but I would like to hear other people's opinions? All comments welcome. @gvwilson @jiffyclub @tbekolay

@tbekolay
Copy link
Contributor

I don't have a problem with assigning to multiple things with tuples, but I don't quite see the motivation for introducing this syntax at this point specifically. If we think people will be confused about it in that exercise, I would think a callout or some explicit text about it would be in order, rather than adding it to an inline code snippet; in a sense, I think it breaks the visual flow of that portion of the lesson (from a certain point onwards, all the code examples just print some small snippet, which is what this code example also does).

That's just my opinion though; if it could be added somewhere where it would save a line instead of introduce additional lines (which is typically why multiple assignment is often used) I would probably react more positively. Also, if you do go ahead with merging this, there are a few minor style issues that should be fixed before merging: double newlines in the code example, and the text change is missing an apostrophe (and should be two separate sentences, IMO).

@alistairwalsh
Copy link
Contributor Author

@tbekolay
Rock and a hard place. The lessons are already too long and I don't want to add any length but after presenting this material it was obvious at that point what I was asking the learners to do had not been explained.

The change I proposed is a bandaid.

Apostrophe accepted though. :-)

@tpoisot
Copy link

tpoisot commented Oct 12, 2015

I think this is important to introduce this particular bit of pythonic syntax.

But maybe it can go in the list parts of the lesson? Currently, the lesson only talks about lists, and not useful data structures (tuples and dicts). I agree that it is a long lesson, but maybe we can use this bit of syntactic sugar to introduce the fact that other data structures exist, and students can look into them?

statkclee pushed a commit to statkclee/python-novice-inflammation that referenced this pull request Jan 4, 2016
@valentina-s
Copy link
Contributor

I suggest introducing multiple assignment in the function lesson as a way to return several variables. As for fixing this exercise, I am ok with assigning all first, second, ... variables individually.

@tbekolay
Copy link
Contributor

I agree that this material would be best in another place, but since we have this material let's merge it for now; we can always move it later. I'll fix the apostrophe and move the multiple assignment comment to the main text in the merge.

@tbekolay tbekolay closed this Jun 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants