Skip to main content

Posts

Inverted Hollow Pyramid or Inverted Hollow Triangle in Python

  Python PatternProgram for Beginners In this article, we are going to print out the hollow inverted triangle or pyramid in python. If you are looking for a Python tutorial series then it's here def pyramid(n): for i in range(1, n+1): for j in range(1, i): print(" ", end="") for j in range(1, (n*2 - (2*i - 1))+1): if i == 1 or j == 1 or j ==(n*2 -(2*i-1)): print("*", end="") else: print(" ", end="") print() pyramid(10) The output of the program is: ******************* * * * * * * * * * * * * * * * * *

Mirror Number Pyramid in Python

Small Python Program For Beginners  In this article, we are going to write code to print out the mirror numbered pyramid using Python Programming. You can see that in the above-featured Image. If you are looking for a Python Tutorial Series, then it's here def triangle(n): for i in range(n): for j in range(n-i-1): print(" ",end=' ') for k in range(i,1,-1): print(k, end=' ') for l in range(1, i+1): print(l,end=' ') print('') triangle(10) The output of the program is: 1 2 1 2 3 2 1 2 3 4 3 2 1 2 3 4 5 4 3 2 1 2 3 4 5 6 5 4 3 2 1 2 3 4 5 6 7 6 5 4 3 2 1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 2 3 4 5 6 7 8 9

Pyramid Alphabet Pattern In Python

  Competitive Programming In Python For Beginners In this article, we are going to print out the Pyramid Alphabet Pattern in Python. If you are looking for a Python Tutorial Series then it's here Before we jump into the code, let's first understand ASCII value and ASCII character ASCII Characters ASCII Value A-Z 65-90 a-z 97-122 0-9 48-57 Spceial Symbols 0-47, 58-64, 91-96, 123-127 The Code Part: def pyramid(num): asciiValue = 65 for i in range(num): for j in range(num-i-1): print(" ", end="") for k in range(asciiValue, asciiValue+i+1): print(chr(k), end="") for l in range(asciiValue, asciiValue+i): print(chr(l), end="") print() pyramid(6) The output of the code is: A ABA ABCAB ABCDABC ABCDEABCD ABCDEFABCDE

Alphabet Pattern Program In Python For Beginners

Small Python Programs For Beginners In this article, we are going to print out the Alphabet Pattern in Python. If you are looking for a Python Tutorial Series then it's here Before we jump into the code, let's first understand ASCII value and ASCII character ASCII Characters ASCII Value A-Z 65-90 a-z 97-122 0-9 48-57 Spceial Symbols 0-47, 58-64, 91-96, 123-127 The Code Part: def alphabet(n): asciiValue = 65 for i in range(asciiValue, asciiValue+n+1): for j in range(i, 64, -1): print(chr(j), end="") print() alphabet(6) The output of the code is: A BA CBA DCBA EDCBA FEDCBA GFEDCBA

Print The Specific String as Pattern in Python Programming (Alphabet Pattern In Python)

  Small Python Program For Beginners . In this article, we are going to print out the Alphabet Pattern in Python. If you are looking for a Python Tutorial Series then it's here Before we jump into the code, let's first understand ASCII value and ASCII character def alphabet(): StrExample = "ROHIT THAKUR" for i in range(0,12): for j in range(0, i+1): print(StrExample[j], end="") print() alphabet() The output of the code is: R RO ROH ROHI ROHIT ROHIT ROHIT T ROHIT TH ROHIT THA ROHIT THAK ROHIT THAKU ROHIT THAKUR

Triangle: Alphabet Pattern in Python Programming Part(3)

  Competitive Programming In Python In this article, we are going to print out the Alphabet Pattern in Python. If you are looking for a Python Tutorial Series then it's here Before we jump into the code, let's first understand ASCII value and ASCII character ASCII Characters ASCII Value A-Z 65-90 a-z 97-122 0-9 48-57 Spceial Symbols 0-47, 58-64, 91-96, 123-127 The Code Part: def alphabet(n): asciiValue = 65 for i in range(asciiValue, asciiValue+n+1): alpha = i for j in range(asciiValue, i+1): print(chr(alpha), end="") alpha +=1 print() alphabet(6) The output of the code is: A BC CDE DEFG EFGHI FGHIJK GHIJKLM

Triangle: Alphabet Pattern in Python Programming (Part 2)

Competitive Programming in Python  In this article, we are going to write code to print out the alphabet triangle as shown in the featured image. If you are looking for a Python tutorial series then it's here Before we jump into the code, let's first understand ASCII value and ASCII character ASCII Characters ASCII Value A-Z 65-90 a-z 97-122 0-9 48-57 Spceial Symbols 0-47, 58-64, 91-96, 123-127 The Code Part: def alphabet(n): asciiValue = 65 for i in range(asciiValue, asciiValue+n+1): for j in range(asciiValue, i+1): print(chr(i), end="") print() alphabet(6) The output of the code is: A BB CCC DDDD EEEEE FFFFFF GGGGGGG