Develop a function in Python to generate the following pattern
1 AB 123 ABCD 12345 ABCDEF 1234567
Solution
n = int(input("Enter the pattern size: "))
for i in range(1, n+1):
#sauravhathi
for j in range(1, i+1):
if i % 2 == 0:
print(chr(j+64), end="")
else:
#sauravhathi
print(j, end="")
print("\r")
Output:
![[Solved] Develop a function in Python to generate the following pattern [Solved] Develop a function in Python to generate the following pattern](https://realcoder.techss24.com/wp-content/uploads/2022/07/image-1.png)
Happy Learning – If you require any further information, feel free to contact me.