Day 16 Python answers_59613207_2025_04_27_17_29
Day 16 Python answers_59613207_2025_04_27_17_29
Day 16
Syllabus Coverage
Flow of Control
- Use of indentation.
Program:
continue
print(num)
Output:
11
13
17
19
23
29
31
37
41
43
47
49
53
59
61
67
71
73
77
79
83
89
91
97
Program:
5x1=5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
5 x 10 = 50
12345
2345
345
45
45
345
2345
12345
Python program to print the hourglass pattern :
n=5
for i in range(n):
# Print numbers
print()
# Print numbers
print()
Explanation:
1. Upper Half:
2. Lower Half:
o The inner loop again prints numbers from i + 1 to n (e.g., for i = 1, it prints 2 3
4 5).
Output:
12345
2345
345
45
45
345
2345
12345