I am trying to write a program that reads an integer and displays, using asterisks, a filled diamond of the given side length. For Example, if the side length is 4, the prog
Thanks Guys, I was able to formulate/correct my code based on the help I received. Thanks for all your input and helping the SO community!
if userInput > 0: # Prevents the computation of negative numbers
for i in range(userInput):
for s in range (userInput - i) : # s is equivalent to to spaces
print(" ", end="")
for j in range((i * 2) - 1):
print("*", end="")
print()
for i in range(userInput, 0, -1):
for s in range (userInput - i) :
print(" ", end="")
for j in range((i * 2) - 1):
print("*", end="")
print()