interjektio theme

Python FizzBuzz challenge

    ____  __  ____    ___________
   / __ \/ / / / /   / ____/ ___/
  / /_/ / / / / /   / __/  \__ \
 / _, _/ /_/ / /___/ /___ ___/ /
/_/ |_|\____/_____/_____//____/


Write the standard FizzBuzz program, in Python, to show us your mad Python skills!

The program shall print the numbers 1...100, each number on its own line.

However:

- When the current number is divisible by 3, the word Fizz is printed instead of the number.

- When the current number is divisible by 5, the word Buzz is printed instead of the number.

- When the number is divisible by both 3 and 5, again, no number is printed, but the string FizzBuzz is printed instead.

That is, when run, the program prints

1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
.
.
and so on, up to
.
.
98
Fizz
Buzz
                    
The MD5 digest of the output shall be d0e6e868d231a6e1fbd87cc2c092676b on a POSIX system (Running on Windows, due to different newline conventions it might also be e76a2755500f4d16c3e49a65d39ddd1e).


Minimum requirements to enter the draw:


The digest of the output matches one of the above. If in doubt, you can check the md5 digest of your output, or you can use our tester code to validate your solution. The code must run correctly on a currently supported Python version (i.e. 3.8+).

Email your solution and contact information to fizzbuzz@interjektio.fi. If you really enjoy Python and are seeking employment then please consider attaching your CV and introduction as well.

However, if you really want to impress us, you should...


Demonstrate your arcane skills!


1. Make it the shortest possible you can think of given the minimum requirements.

2. In addition to 1., write the Python code so that your program only has a single line of code. (a one-liner)

3. In addition to 1 and 2, write the code so that it does not contain any of the lower-case letters c, f, v, w or x

4. In addition to the above, squeeze it under 100 bytes!

5. All of the above and < 85 bytes


Too easy?


6. The code in fizzbuzz.py uses only one variable: a, and has the following properties:


% python2 fizzbuzz.py | md5sum

d0e6e868d231a6e1fbd87cc2c092676b -

% python3 fizzbuzz.py | md5sum

d0e6e868d231a6e1fbd87cc2c092676b -

% md5sum fizzbuzz.py

5d4dcb62fdf1fadf549344f449ba483d fizzbuzz.py

% grep "[cfvwx]" fizzbuzz.py

% wc fizzbuzz.py

1 1 115 fizzbuzz.py


and the set of characters in the source code in the order of their first appearance is



  a=list(mpr,nge10);[2:3]'Fz*45Bu6\.jo

can you recover the original code in fizzbuzz.py?



Submit your solution


Email your solution and contact information to fizzbuzz@interjektio.fi. If you really enjoy Python and are seeking employment then please consider attaching your CV and introduction as well.