Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
FizzBuzz Coding Challenge
00:00
5 left

FizzBuzz Coding Challenge

EasyPython

Problem

Write a program that prints each number from 1 to 100 on a new line; for multiples of 3 print "Fizz", for multiples of 5 print "Buzz", and for multiples of both print "FizzBuzz".

Implement this as fizz_buzz(), returning a list of 100 strings in output order instead of printing directly. Numbers that are not multiples of 3 or 5 should be returned as their decimal string representation.

Constraints

  • The function takes no arguments.
  • The output contains exactly 100 strings.
  • The sequence represents integers from 1 through 100 in ascending order.
  • Multiples of both 3 and 5 must be labeled "FizzBuzz".

Function Signature

def fizz_buzz():
Interviewer

Your question is FizzBuzz Coding Challenge. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePython 3
You need to log in / sign up to run or submit.Ln 2
Run your code to see test output here.