Skip to content

Instantly share code, notes, and snippets.

@nattybear
Created April 5, 2017 03:24
Show Gist options
  • Select an option

  • Save nattybear/caa4338c9ff7a47ed161e25295f20a40 to your computer and use it in GitHub Desktop.

Select an option

Save nattybear/caa4338c9ff7a47ed161e25295f20a40 to your computer and use it in GitHub Desktop.
while True:
num = int(input())
if (num < 3) or (num % 2 == 0): continue
space = int(num / 2)
for i in range(1, num, 2):
print(' ' * space + '*' * i)
space -= 1
print('*' * num)
for i in range(num-2, 0, -2):
space += 1
print(' ' * space + '*' * i)
select = int(input())
if select == 0: break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment