Skip to main content

I want to Print a pattern if the input is 5 

then print 

A B 

1 2 3 

A B C D 

1 2 3 4 5  like this 

anyone can help me like how to print A B C D 

@rishav_anand Use Python. 

n = int(input("Enter a number: "))

for i in range(1, n + 1):
if i % 2 == 1: # Odd rows = numbers
for j in range(1, i + 1):
print(j, end=" ")
else: # Even rows = letters
for j in range(1, i + 1):
print(chr(64 + j), end=" ") # chr(65) is 'A'
print() # new line after each row

 


@Aaron.Gleason thanks for the code but i want to print this with the help of automation anywhere without using python 

 


@rishav_anand Automation Anywhere is not a general programming language. It is a business automation language. As such, Python is a better language for this specific exercise. You can integrate Python directly into Automation Anywhere, and we frequently do for tasks such as yours that are more a programmer exercise than a business automation exercise. It’s a matter of using the right tool for the job.

That being said… it can be done…