Answers for "nested loops to print patters"

1

pyramid pattern in python

n = 3
for i in range(1, n+1):
  print(f"{' '*(n-i)}{' *'*i}"[1:])
  
# Output:
#  *
# * *
#* * *
Posted by: Guest on February-23-2021
0

* pattern by python

def pattern(n):    
  for i in range(0,n):       
    for j in range(0, i+1): 
      print("* " , end="")         
      print("r") pattern(5
Posted by: Guest on December-02-2020

Code answers related to "nested loops to print patters"

Python Answers by Framework

Browse Popular Code Answers by Language