diff --git a/Pattern/main.py b/Pattern/main.py index 58d1881..e913e2e 100644 --- a/Pattern/main.py +++ b/Pattern/main.py @@ -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