Skip to content

Instantly share code, notes, and snippets.

@jklydev
Last active March 13, 2017 10:27
Show Gist options
  • Save jklydev/cdf4300ef42d7d337b811eae47e3eebe to your computer and use it in GitHub Desktop.
Save jklydev/cdf4300ef42d7d337b811eae47e3eebe to your computer and use it in GitHub Desktop.
def flatten(lst):
flt_lst = []
for item in lst:
if not type(item) == list:
flt_lst.append(item)
else:
flt_lst.extend(flatten(item))
return flt_lst
def fizzbuzz(n=101):
for i in range(1, n):
output = ""
if i % 3 == 0:
output += "Fizz"
if i % 5 == 0:
output += "Buzz"
print(output or i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment