Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

60%
+1 −0
Challenges 1, 2, Fizz, 4, Buzz!

Python 3, 64 62 bytes for i in range(1,101):print("Fizz"*(i%3<1)+"Buzz"*(i%5<1)or i) Try it online! Saved two bytes thanks to Moshi‭ in the comments.

posted 2y ago by celtschk‭  ·  edited 2y ago by celtschk‭

Answer
#4: Post edited by user avatar celtschk‭ · 2021-09-30T06:10:31Z (over 2 years ago)
I had accidentally deleted the links
  • # [Python 3], <s>64</s> 62 bytes
  • <!-- language-all: lang-python -->
  • for i in range(1,101):print("Fizz"*(i%3<1)+"Buzz"*(i%5<1)or i)
  • [Try it online!][TIO-ku6j8irp]
  • Saved two bytes thanks to [Moshi‭](https://codegolf.codidact.com/users/53196) in the [comments](https://codegolf.codidact.com/comments/thread/4643#comment-13940).
  • # [Python 3], <s>64</s> 62 bytes
  • <!-- language-all: lang-python -->
  • for i in range(1,101):print("Fizz"*(i%3<1)+"Buzz"*(i%5<1)or i)
  • [Try it online!][TIO-ku6jcjdz]
  • Saved two bytes thanks to [Moshi‭](https://codegolf.codidact.com/users/53196) in the [comments](https://codegolf.codidact.com/comments/thread/4643#comment-13940).
  • [Python 3]: https://docs.python.org/3/
  • [TIO-ku6jcjdz]: https://tio.run/##K6gsycjPM/7/Py2/SCFTITNPoSgxLz1Vw1DH0MBQ06qgKDOvREPJLbOqSklLI1PV2MZQU1vJqRTKNQVyQfo0//8HAA "Python 3 – Try It Online"
#3: Post edited by user avatar celtschk‭ · 2021-09-30T06:06:51Z (over 2 years ago)
Saved two bytes thanks to @Moshi‭ in the comments
  • # [Python 3], 64 bytes
  • <!-- language-all: lang-python -->
  • for i in range(1,101):print("Fizz"*(i%3==0)+"Buzz"*(i%5==0)or i)
  • [Try it online!][TIO-ktdzvc31]
  • [Python 3]: https://docs.python.org/3/
  • [TIO-ktdzvc31]: https://tio.run/##K6gsycjPM/7/Py2/SCFTITNPoSgxLz1Vw1DH0MBQ06qgKDOvREPJLbOqSklLI1PV2NbWQFNbyakUyjcF8UE6Nf//BwA "Python 3 – Try It Online"
  • # [Python 3], <s>64</s> 62 bytes
  • <!-- language-all: lang-python -->
  • for i in range(1,101):print("Fizz"*(i%3<1)+"Buzz"*(i%5<1)or i)
  • [Try it online!][TIO-ku6j8irp]
  • Saved two bytes thanks to [Moshi‭](https://codegolf.codidact.com/users/53196) in the [comments](https://codegolf.codidact.com/comments/thread/4643#comment-13940).
#2: Post edited by user avatar celtschk‭ · 2021-09-10T06:45:14Z (over 2 years ago)
Removed one byte of unnecessary whitespace
  • # [Python 3], 65 bytes
  • <!-- language-all: lang-python -->
  • for i in range(1,101):print("Fizz"*(i%3==0)+"Buzz"*(i%5==0) or i)
  • [Try it online!][TIO-ktdzrh1f]
  • [Python 3]: https://docs.python.org/3/
  • [TIO-ktdzrh1f]: https://tio.run/##K6gsycjPM/7/Py2/SCFTITNPoSgxLz1Vw1DH0MBQ06qgKDOvREPJLbOqSklLI1PV2NbWQFNbyakUyjcF8RVAWjX//wcA "Python 3 – Try It Online"
  • # [Python 3], 64 bytes
  • <!-- language-all: lang-python -->
  • for i in range(1,101):print("Fizz"*(i%3==0)+"Buzz"*(i%5==0)or i)
  • [Try it online!][TIO-ktdzvc31]
  • [Python 3]: https://docs.python.org/3/
  • [TIO-ktdzvc31]: https://tio.run/##K6gsycjPM/7/Py2/SCFTITNPoSgxLz1Vw1DH0MBQ06qgKDOvREPJLbOqSklLI1PV2NbWQFNbyakUyjcF8UE6Nf//BwA "Python 3 – Try It Online"
#1: Initial revision by user avatar celtschk‭ · 2021-09-10T06:42:21Z (over 2 years ago)
# [Python 3], 65 bytes

<!-- language-all: lang-python -->

    for i in range(1,101):print("Fizz"*(i%3==0)+"Buzz"*(i%5==0) or i)

[Try it online!][TIO-ktdzrh1f]

[Python 3]: https://docs.python.org/3/
[TIO-ktdzrh1f]: https://tio.run/##K6gsycjPM/7/Py2/SCFTITNPoSgxLz1Vw1DH0MBQ06qgKDOvREPJLbOqSklLI1PV2NbWQFNbyakUyjcF8RVAWjX//wcA "Python 3 – Try It Online"