Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missed opportunity to talk about indentation in "Programming with Python : Repeating actions with loops" #687

Open
datasolver opened this issue Jul 29, 2019 · 2 comments
Labels
status:need more info More information needed type:enhancement Propose enhancement to the lesson

Comments

@datasolver
Copy link

datasolver commented Jul 29, 2019

One of the key problems I had when I started programming (in python) was with indentation especially with "for loops" and "if statements". I believe most beginners will have the same or similar issues. Therefore, I think this lesson (Programming with Python : Repeating actions with loops) is a golden opportunity to let learners have a feel of what problems they can run into without proper indentation. For example, how will the intended answer be affected if:

This code:

length = 0
for vowel in 'aeiou':
    length = length + 1
print('There are', length, 'vowels')

was written as:

length = 0
for vowel in 'aeiou':
    length = length + 1
    print('There are', length, 'vowels')
@maxim-belkin
Copy link
Contributor

Thanks, Jamiu! You're right and, in fact, you hit a very important issue that we've got in our episode on for loops: indentation is not emphasized enough. The word indent occurs only twice in the episode: once in the body of the lesson, and once in keypoints. I suggest to discuss how to go about this and then... submit pull request(s)!

@maxim-belkin maxim-belkin added the type:enhancement Propose enhancement to the lesson label Jul 29, 2019
@maxim-belkin maxim-belkin added the status:need more info More information needed label Aug 26, 2019
@HallidayDF
Copy link

I think there's a perfect opportunity to discuss it in the segment after "What's in a name". The lesson already calls for following the loop step by step to see how indented code inside the loop changes the variable defined outside the loop, I think one extra example to demonstrate how indenting the last line changes the output would fit in nicely. Potentially even squeezing in a 3rd example to demonstrate that users need to be consistent with their indentation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:need more info More information needed type:enhancement Propose enhancement to the lesson
Projects
None yet
Development

No branches or pull requests

3 participants