-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fbe393e
commit b14c3cd
Showing
1 changed file
with
12 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,25 @@ | ||
|
||
# Pattern 1: Square Pattern | ||
for i in range(4): | ||
for i in range(4): | ||
print("# ", end="") | ||
for j in range(4): # Use 'j' as the inner loop variable | ||
print("# ", end="") # Print '#' without a newline | ||
|
||
print() | ||
print() # Move to the next line after each row | ||
|
||
print("Using Pattern 1") | ||
print("") # Print a blank line for spacing | ||
|
||
print("") | ||
|
||
# printing in pattern | ||
|
||
# Pattern 2: Right-Angled Triangle (Left-Aligned) | ||
print("Using Pattern 1") | ||
for i in range(4): | ||
for j in range(i + 1): | ||
for j in range(i + 1): # Print increasing number of '#' | ||
print("# ", end="") | ||
|
||
print() | ||
|
||
print() # Move to the next line after each row | ||
|
||
print("Using Pattern 2") | ||
|
||
# printing in pattern | ||
|
||
# Pattern 3: Inverted Right-Angled Triangle | ||
for i in range(4): | ||
for j in range(4 - i): | ||
for j in range(4 - i): # Print decreasing number of '#' | ||
print("# ", end="") | ||
|
||
print() | ||
print() # Move to the next line after each row |