In Episode 3 of Programming with Python, there is an exercise which shows that as a for loop iterates through a string of the five vowels, a variable is updated. I have found that this exercise skips a few logical steps, and that users who are new to Python struggle to understand the outcome of this loop.
I recommend augmenting the loop slightly so that instead of
This would provide a sort of hard-coded enumeration example that could show learners how the steps occur on each iteration, and really drive home the idea that loops are moving through each character in a string. It will only help learners reinforce ideas that are taught earlier in the lesson through repetition.
Hi @CRWayman, I think your suggestion in this issue would be a good addition. Not only does it help clarify what is happening, but it also shows that you can execute multiple lines of code within the for loop, which I don't think is shown in this episode's content. Do you have any thoughts about using print(length, vowel) to show the output of each iteration on one line rather than doing the two print statements individually? We welcome a PR to address this issue. Thank you!
Hello! I agree that the combination would be better as a single line print statement, I also think it's a good way to reiterate to beginners that you can print multiple variables in a print statement. I'm not sure how to do this as a pull request, are there instructions on how to do this? I wouldn't want to mess anything up. :)