15 - Write a program in Python to generate the following pattern using nested loops:
*
**
***
****
*****
for i in range(1,6):
for j in range(1,i+1):
print("*",end='')
print()
*
**
***
****
*****
*
**
***
****
*****
for i in range(1,6):
for j in range(1,i+1):
print("*",end='')
print()
*
**
***
****
*****
A
AB
ABC
ABCD
ABCDE
for i in range(1,6):
for j in range(1,i+1):
print(chr(j+64),end='')
print()
Output:
A
AB
ABC
ABCD
ABCDE
5
54
543
5432
54321
for i in range(5,0,-1):
for j in range(5,i-1,-1):
print(j,end='')
print()
Output:
5
54
543
5432
54321
54321
5432
543
54
5
for i in range(1,6):
for j in range(5,i-1,-1):
print(j,end='')
print()
Output:
54321
5432
543
54
5
55555
4444
333
22
1
for i in range(5,0,-1):
for j in range(1,i+1):
print(i,end='')
print()
Output:
55555
4444
333
22
1
12345
1234
123
12
1
for i in range(5,0,-1):
for j in range(1,i+1):
print(j,end='')
print()
Output:
12345
1234
123
12
1
1
22
333
4444
55555
for i in range(1,6):
for j in range(1,i+1):
print(i,end='')
print()
Output:
1
22
333
4444
55555
1
12
123
1234
12345
for i in range(1,6):
for j in range(1,i+1):
print(j,end='')
print()
Output:
1
12
123
1234
12345
11111
22222
33333
44444
55555
for i in range(1,6):
for j in range(1,6):
print(i,end='')
print()
Output:
11111
22222
33333
44444
55555
12345
12345
12345
12345
12345
for i in range(1,6):
for j in range(1,6):
print(j,end='')
print()
Output:
12345
12345
12345
12345
12345