Question: this is the code i got for making a diamond. However, the diamond is not even. How can I make it even? for i

this is the code i got for making a diamond. However, the diamond is not even. How can I make it even?

 

for i in range (1,10):
   print (" "*(10-i),"*"*(2*i-1))

for i in range(10):
   
   for j in range(0, i):
       print(" ", end="")
   for k in range(2 * (10 - i) - 1):
       print("*", end="")
   print()

Step by Step Solution

3.43 Rating (162 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To make a symmetric diamond pattern you can modify ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!