Search This Blog
Available Codings for Programming of C, C++, PYTHON, JAVA and HTML.
Welcome to Coding 4 Programming
- Get link
- X
- Other Apps
Labels
Star Patterns (Four Types) | Pyramid Star Pattern | Reverse Pyramid Star | Python
Python Program of Four Types of Star Patterns, Simple Star Pattern, Reverse Simple Star Pattern, Pyramid Star Pattern and Reverse Pyramid Star Pattern, through For Loop.
- Coding for the above Program.
- n=int(input("Enter Number of Rows="))
- print("Simple Star Pattern:")
- for i in range(n):
- print("*" * (i+1))
- print("Reverse Simple Star Pattern:")
- for i in range(n):
- print("*" * (n-i))
- print("Pyramid Star Pattern")
- for i in range(n):
- print(" " * (n-i-1), end="")
- print("*" * (2*i+1), end="")
- print(" " * (n-i-1))
- print("Reverse Pyramid Star Pattern")
- for i in range(n-1,-1, -1):
- print(" " * (n-i-1), end="")
- print("*" * (2*i+1), end="")
- print(" " * (n-i-1))
- Visual Studio Screenshot with Output of above Program
- Get link
- X
- Other Apps
Labels:
Python
Popular Posts
To Check Prime Number | For Loop | Python
- Get link
- X
- Other Apps
To Check Perfect Number | Function | For Loop | Python
- Get link
- X
- Other Apps
Comments
Post a Comment