39.WAp to display following pattern
A
A B
A B C
A B C D
CODE:
x="A"
n=int(input("How many rows\n"))
for i in range(1,n+1):
for j in range(0,i):
print(chr(ord(x)+j),end=" ")
print()
OUTPUT:
How many rows
4
A
A B
A B C
A B C D
A
A B
A B C
A B C D
CODE:
x="A"
n=int(input("How many rows\n"))
for i in range(1,n+1):
for j in range(0,i):
print(chr(ord(x)+j),end=" ")
print()
OUTPUT:
How many rows
4
A
A B
A B C
A B C D
Comments
Post a Comment