1) ord() function return the unicode from a given character
n=int(input("enter the number"))
k=ord("A")
for i in range(n):
for j in range(i+1):
print(chr(k),end=" ")
k=k+1
print()
2)
def pattern(n):
num=65
for i in range(0,n):
# print(i)
for j in range(0,i+1):
ch=chr(num)
print(ch,end='')
num=num+1
print("\r")
n=5
pattern(n)
Oldest comments (0)