[Solved] How can I remove the ‘none’ out of the output? [closed]
Here’s a modification on @schwobasggl’s answer, using f-strings that works in Python 3.6+ def up_and_down(n): # 1,2, …, n, …, 2, 1 return (*range(1, n), *range(n, 0, -1)) def diamond(n, pad=’#’, fill=”*”): w = (2 * n) – 1 for i in up_and_down(n): # you can also use the below, but it’s slightly less performant: … Read more