Computer Science
Write programs using nested loops to produce the following patterns:
0
2 2
4 4 4
6 6 6 6
8 8 8 8 8
Python
Python Control Flow
28 Likes
Answer
for i in range(0, 10, 2):
for j in range(0, i + 1, 2) :
print(i, end = ' ')
print()
Output
0
2 2
4 4 4
6 6 6 6
8 8 8 8 8
Answered By
14 Likes
Related Questions
Write a program using nested loops to produce a rectangle of *'s with 6 rows and 20 *'s per row.
Write programs using nested loops to produce the following patterns:
A
B B
C C C
D D D D
E E E E EWrite programs using nested loops to produce the following patterns:
A
A B
A B C
A B C D
A B C D E
A B C D E FWrite programs using nested loops to produce the following patterns:
2
4 4
6 6 6
8 8 8 8