I've tried to make my code efficient by reducing the number of loops/print functions compared with my solution in c. My code works, but check50 isn't happy with it -- apparently an extra space is printed per line? Anyone able to spot the issue?
from cs50 import get_int
height = get_int("Height: ")
if height > 7 or height < 1:
print("no thanks")
height = get_int("Height: ")
else:
for i in range(height):
j = i + 1
spaces = height - j
print(f" " * spaces, "#" * (i + 1), "", "#" * j)