Skip to content

Instantly share code, notes, and snippets.

@youknowcast
Created June 30, 2019 05:11
Show Gist options
  • Save youknowcast/4bc0c8c6547c0d552c843e5738f84cda to your computer and use it in GitHub Desktop.
Save youknowcast/4bc0c8c6547c0d552c843e5738f84cda to your computer and use it in GitHub Desktop.
challenge1-1 fizz_buzz.py
all_map = {}
fb_map = {}
f_map = {}
b_map = {}
all_map[0] = 0
i = 1
for i in range(200):
all_map[i] = i
fb_map[i * 15] = 'FizzBuzz'
f_map[i * 3] = 'Fizz'
b_map[i * 5] = 'Buzz'
all_map.update(f_map)
all_map.update(b_map)
all_map.update(fb_map)
def fb(num):
return all_map[num]
i = 1
while i <= 200:
print(i, fb(i))
i = i + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment