I am using the fizz buzz exercise to learn a little about python. I have hardcoded a range of 1-100 but I was curious how I might accomplish the same result by passing the range into the function using the parameter?
numbers = range (1,101)
def fizzbuzz(numbers):
for each in numbers:
if each % 3 == 0 and each % 5 == 0:
print "fizzbuzz"
elif each % 3 == 0:
print "fizz"
elif each % 5 == 0:
print "buzz"
else:
print each
print fizzbuzz(numbers)