Course Content
Python Loops Tutorial
Python Loops Tutorial
If/Else in a Nested Loop
Utilizing if
statements remains consistent whether applied within nested loops or in a single while
or for
loop.
Examine the code below:
How does the code work?

We've just observed an example of utilizing if/else
within a nested loop while handling the matrix.
Now, in your assignment, you'll be dealing with two strings.
Feel free to refer to hints if necessary!
Task
Print all the vowels from the text
.
- Initialize
i
. - Configure the outer
while
loop to iterate through the number of elements in thetext
. - Configure the inner
for
loop to iterate through the number of elements in thevowels
. - Implement the condition: if an element in the
text
matches one of the elements invowels
, then print the element.
Everything was clear?
Section 3. Chapter 5