Skip to content

Instantly share code, notes, and snippets.

View Polydynamical's full-sized avatar

Polydynamical

  • Corona, California
View GitHub Profile
@Polydynamical
Polydynamical / fizzbuzz.py
Last active August 3, 2023 03:59
Branchless 1-line Solution to FizzBuzz
for n in range(1, 101): print("fizz" * (n % 3 == 0) + "buzz" * (n % 5 == 0) + ((n % 3 != 0) and (n % 5 != 0)) * str(n));
This file has been truncated, but you can view the full file.
2
3
5
7
11
13
17
19
23
29
2
3
5
7
11
13
17
19
23
29
This file has been truncated, but you can view the full file.
1
1
2
3
5
8
13
21
34
55
1
1
2
3
5
8
13
21
34
55