In this lesson we start to combo our existing knowledge of lists, making choices and the for loop to get more sophisticated with the programs we write.
We will cover the For Loop, the range() function as well as making choices in a loop.
RESOURCES AND LINKS MENTIONED IN THIS VIDEO:
00:41 – Introduction to Loops and Repetitions
01:18 – The For Loop
04:23 – Looping Through a String
04:46 – The range() Function
06:35 – Making Choices in Loops
08:43 – The continue statement
More on for loops:
https://docs.python.org/3/tutorial/controlflow.html#for-statements
More on the continue statement:
https://docs.python.org/3/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops
Python for the Anxious Artist Series Playlist: https://www.youtube.com/playlist?list=PLjdX5s0F2DqZYcjKn2QIlNKorQ2E3Lws5
Blog Post: python-for-the-anxious-cg-artist-08–for-loops
Sign up for my FREE Insider’s Newsletter for More Tips and Insights: https://www.nelsonlim.com/learn/
EXERCISE(S)
Programming, like learning to model or play the piano is all about practice.
# Write a python program that will print the below pattern,
# Using for loops.
*
* *
* * *
* * * *
* * * * *
# If you got the above to work, try this!
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*
# Write a python script that checks the number of vowels(aeiou)
# in user specified phrase and prints the number of vowels.
Give me a phrase: Anxious Artist
There are 6 vowels in "Anxious Artist".
Leave a Reply