Skip to content

Instantly share code, notes, and snippets.

View MarkPuchalaII's full-sized avatar
:octocat:
Looking for Work

Mark Puchala 2/ MarkPuchalaII

:octocat:
Looking for Work
View GitHub Profile
@MarkPuchalaII
MarkPuchalaII / fizzBuzz.py
Created June 5, 2018 20:49
FizzBuzz Python Solution
# Print the numbers from 1 to 100.
# But for multiples of three print “Fizz”
# and for multiples of five print “Buzz”
# For multiples of both print “FizzBuzz”
for i in range(1,100) :
s = '' # Reset our string with every loop
if i%3 == 0 : s = 'Fizz' # Test if it's got a Fizz
if i%5 == 0 : s = 'Buzz' # Test if it's got a Buzz, too
if s == '' : s = i # If it's still in its original state (no fizz, no buzz)