pyramid of numbers pattern in python code example
Example: pyramid pattern in python
n = 3
for i in range(1, n+1):
print(f"{' '*(n-i)}{' *'*i}"[1:])
# Output:
# *
# * *
#* * *
n = 3
for i in range(1, n+1):
print(f"{' '*(n-i)}{' *'*i}"[1:])
# Output:
# *
# * *
#* * *