Last active
November 21, 2022 19:55
-
-
Save arikchakma/4328ac5d67f89a7b1d74b25c9cf8eb63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| n = int(input("Enter any Real number: ")) | |
| for i in range(n): | |
| for j in range(i + 1): | |
| print("*", end=" ") | |
| print() | |
| # Result: | |
| # * | |
| # * * | |
| # * * * | |
| # * * * * | |
| # * * * * * | |
| for i in range(n): | |
| for j in range(i, n): | |
| print("*", end=" ") | |
| print() | |
| # Result: | |
| # * * * * * | |
| # * * * * | |
| # * * * | |
| # * * | |
| # * | |
| for i in range(n): | |
| for j in range(i): | |
| print(" ", end=" ") | |
| for j in range(i, n): | |
| print("*", end=" ") | |
| print() | |
| # Result: | |
| # * * * * * | |
| # * * * * | |
| # * * * | |
| # * * | |
| # * | |
| for i in range(n): | |
| for j in range(i): | |
| print(" ", end=" ") | |
| for j in range(i, (n - 1)): | |
| print("*", end=" ") | |
| for j in range(i, n): | |
| print("*", end=" ") | |
| print() | |
| # Result: | |
| # * * * * * * * * * | |
| # * * * * * * * | |
| # * * * * * | |
| # * * * | |
| # * |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment