The following are my solutions to the "Fizzbuzz"python Coding Challenge.
The intent was to define a function as it pertains to the coursework covered in “Preparing for the Technical Interview”.
The first function follows the instructions step-by-step
This includes the general syntax expected. I also intended to provide very readable code for the benefit of anyone who may need it.
The second function solution is refactored and more advanced.
# Write your code here
fizzy = 
for num in range(1, limit + 1):
if (num % 3 == 0 and num % 5 == 0):
elif num % 5 == 0:
elif num % 3 == 0:
This second function outputs line by line by line not a list.
print(*map(lambda i: 'Fizz'*(not i%3)+'Buzz'*(not i%5) or i, range(1,101)),sep='\n')
I like the use of the lambda function. Nice work.
Equivalent to saying,
'function function'. A
lambda is an anonymous immediately executing function that acts upon an iterable.
Bottom line, it’s a lambda or it’s a function. They are quite differently purpose based.