0% found this document useful (0 votes)
12 views2 pages

Understanding Nested Loops in Python

The document explains nested loops in Python, describing how an outer loop controls the iterations of an inner loop. It provides examples of using nested loops to display multiplication tables and generate a pyramid of stars. Additionally, it includes a program to check a list of words for vowels and display those that contain them.

Uploaded by

addxca
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Understanding Nested Loops in Python

The document explains nested loops in Python, describing how an outer loop controls the iterations of an inner loop. It provides examples of using nested loops to display multiplication tables and generate a pyramid of stars. Additionally, it includes a program to check a list of words for vowels and display those that contain them.

Uploaded by

addxca
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Nested loops:

A nested loop in Python is a loop inside another loop.


The outer loop controls the number of iterations for the inner loop.
The inner loop executes completely for every single iteration of the outer loop.

Example:
For each value of i, inner loop will be executed completely.
Only then outer loop will move to next value of i.

Wtite a program to display the tables of first 5 numbers using nested loop.
Examples:
Generate pyramid of starts of n levels.

Write a program that checks a list of words and display the words that contain any vowel.

You might also like