Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It should be possible in a single line of Python..

  pip install fizzbuzz
And then:

  import fizzbuzz
  print fizzbuzz.fizzbuzz()
Or for the second solution:

  print fizzbuzz.fizzbuzzbazz()


A tweetable (140 character) single line of Python:

print '\n'.join((lambda x:(''.join(x) if x else str(i)))([w+'zz' for (n,w) in ((3,'Fi'),(5,'Bu'),(7,'Ba')) if i%n==0]) for i in range(1,100))




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: