sandiegopython / intro-to-python

Introduction to Python (2014)
Creative Commons Attribution 4.0 International
28 stars 26 forks source link

Part 4: squared_numbers - First Example of list comprehension. #17

Closed riseriyo closed 10 years ago

riseriyo commented 10 years ago

Concerning the squared_numbers example: Ok, I'm assuming that you are going to go over how the list comprehension is written out differently from a for-loop, correct? e.g., what part of the for-loop is where in the list comprehension, etc.

treyhunner commented 10 years ago

What's written is all we have right now. I agree that the explanation for that part doesn't feel entirely complete. I haven't found a good explanation of list comprehensions online that didn't rely heavily on examples to teach the syntax.

macro1 commented 10 years ago

I was looking at this a bit yesterday evening... I think someone needs to make an image linking the different loop parts to show how they are the same pieces shuffled. The notbooks seem a bit too restrictive to do it directly through formatting.

willingc commented 10 years ago

Closing since this seems to be addressed in current Part 4 version and PR #41. Please reopen if needed. :cookie: