for row in range(row_len := int(input("Enter the length of the pyramid: "))): print(((row_len * 2 - 1) // 2 - row) * " " + "* " * (row + 1)) # By Omar Alanazi # Output example (if user enters 3) # * # * * #* * *