Computer Science
Write programs using nested loops to produce the following patterns:
A
B B
C C C
D D D D
E E E E E
Python
Python Control Flow
28 Likes
Answer
n = 5
t = 65
for i in range(n) :
for j in range(i + 1) :
print(chr(t), end = ' ')
t += 1
print()
Output
A
B B
C C C
D D D D
E E E E E
Answered By
8 Likes
Related Questions
Write 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 8Write programs to print the following shapes:
*
* *
* *
* *
* *
* *
*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