Fizz Buzz

  for n in range(1, 101):
      line = ""
      if n%3 == 0:
          line = line + "Fizz"
      if n%5 == 0:
          line = line + "Buzz"

if line: print line else: print n

An example of FizzBuzz being written from the ground up using Test-Driven Development and Ruby: https://www.youtube.com/watch?v=CHTep2zQVAc


EditText of this page (last edited November 25, 2014) or FindPage with title or text search