id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

logic_fizzBuzz


A famous programming interview problem is the FizzBuzz problem. This is a slightly modified version. Given an integer "num", make a list of strings. Then, fill it with the Strings "1", "2", "3", "4", ... etc, BUT, whenever you hit a multiple of 3, replace it with "Fizz" and if you hit a multiple of "5" replace it with "Buzz". If the number is a multiple of both 3 and 5, instead replace it with "FizzBuzz". Look at the example inputs and outputs!


logic_fizzBuzz(1) → ['1']
logic_fizzBuzz(2) → ['1', '2']
logic_fizzBuzz(3) → ['1', '2', 'Fizz']

...Save, Compile, Run (ctrl-enter)

def logic_fizzBuzz(n):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Post-solution available

Copyright Nick Parlante 2017 - privacy