Skip to content

Instantly share code, notes, and snippets.

@brandongupton
Created December 13, 2021 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandongupton/be60262d753b93035275fa5017ee67d1 to your computer and use it in GitHub Desktop.
Save brandongupton/be60262d753b93035275fa5017ee67d1 to your computer and use it in GitHub Desktop.
Merry-Christmas question
with open('merry-christmas.txt') as f:
l = f.readline()
try:
x = int(l)
except:
x = 25
w = open('happy-holidays.txt', 'w')
for i in range(1, x + 1):
w.write(' ' * (x - i))
w.write('*' * (i + i - 1) + '\n')
w.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment