Create Alphabet ‘C’ in Python

thumbnail

In this tutorial, you will learn to create alphabet ‘C’ in python. The code is implement in the below.

def alphabetC(n):
  for i in range(0,n):
    for j in range(0,n):
      if(i==0 or j==0 or i==n-1):
        print("*", end =" "),
      else:
        print(" ", end =" "),
    print("")

alphabetC(3)
print()
alphabetC(5)
print()
alphabetC(7)
* * * 
*     
* * * 

* * * * * 
*         
*         
*         
* * * * * 

* * * * * * * 
*             
*             
*             
*             
*             
* * * * * * * 
Back To Top