Answer to Question #299961 in Python for sruthi

Question #299961

*

* *

* * *

* * * *

* * * * *

* *

* *

* *

*

can i get the exact code for this.


1
Expert's answer
2022-02-19T16:56:25-0500
def pattern(n):
      for i in range(0, n):
           for j in range(0, i + 1):
                print("* ", end="")
           print()
      for i in range(n, -1 , -1):
          for j in range(0, i + 1):
               print("* ", end="")
          print()


pattern(4)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS