Day 15 Python Answers - 59533843 - 2025 - 04 - 26 - 06 - 18
Day 15 Python Answers - 59533843 - 2025 - 04 - 26 - 06 - 18
Day 15
Syllabus Coverage
Flow of Control
- Use of indentation.
break Statement
Example:
if num == 5:
print(num)
Output:
2
3
continue Statement
Example:
if num == 3:
print(num)
Output:
Definition:
A nested loop is a loop inside another loop. The inner loop completes all its iterations for
each iteration of the outer loop.
Output:
2. Key Logic:
Program:
n = 4 # Number of rows
# Print stars
for k in range(2 * i - 1):
print()
Output:
***
*****
*******
Explanation:
3. Loop 3 (k) → Prints (2*i - 1) stars (e.g., 2*1-1=1 star in Row 1, 2*2-1=3 in Row 2, etc.).
n=4
Output :
***
*****
*******