You are tasked with printing a pyramid pattern of stars based on a given screenshot
I hope you’ll assist us; we need only an approach."
You are tasked with printing a pyramid pattern of stars based on a given screenshot
I hope you’ll assist us; we need only an approach."
Hi…
I have solved the 2nd pattern recently…
Check with this, it includes getting input from user too…
n = int(input(“Enter the number of rows”))
def full_pyramid(n):
for i in range(1, n + 1):
# Print leading spaces
for j in range(n - i):
print(" “, end=”")
# Print asterisks for the current row
for k in range(1, 2*i):
print("*", end="")
print()
full_pyramid(n)