Alphabet Patterns Using Python

#-------------------------Incrementing Left right angle triangle -------------------- 

a=int(input("enter the number: "))
for i in range(a): # ranges from 0 to a-1
    print((chr(65+i)+" ")*(i+1)) # prints the character at 65+i along with " " for i+1 times
#------------------------------ Down arrow alphabet triangle ------------------------

x=int(input("enter the number: "))
for i in range(x):
    print(" "*i,end=" ") # prints " " for i times
    for j in range(x-i): # ranges from 0 to x-i 
        print(chr(65+j),end=" ")# prints the character at 65+j 
    print()
#--------------------Down hollow traiangle, 1 letter in arrow ----------------------

x=int(input("enter the number: "))
for i in range(x):
    print("  "*i+chr(65+i)+" ",end=" ")
    if i!=(x-1):
        print( "  "*((2*x)-(2*i)-3)+chr(65+i),end=" ")
    print()


#--------------------------- Alphabet Square shape ----------------------------------

a=int(input("Enter the number: "))
for i in range(a): #ranges from 0 to a-1
    print("A "*a) # prints "A" for a times in rows and columns
#--------------------------- Right arrow triangle  ------------------------------

a=int(input("Enter the number: "))
for i in range(a):
    for j in range(i+1):
        print(chr(65+j),end=' ')
    print()
for i in range(a-1):
    for j in range(a-i-1):
        print(chr(65+j),end=" ")
    print()

Join our team, where career growth knows no limits.

For More Details

Our internship program guarantees personalized attention for optimal career development in the tech industry.

+91 97879 68375

-> You should bring your own laptop during the internship

Who can apply?

Internships are open for students who: B.E / B.Tech / M.E / M.Tech / B.Sc / M.Sc / M.C.A / B.C.A / Diploma.

  • Ongoing Students Only
  • days, 5days/ 10days or Based on Student Preference
  • Limited 1 to 10 students per slot
  • Registration fees : 1000 INR
  • Slots are filling quickly only fewer slots are available