The challenge

Write a function that always returns 5

Sounds easy right? Just bear in mind that you can’t use any of the following characters: 0123456789*+-/

The solution in Python code

Option 1:

1
2
def unusual_five():
    return len(['a','b','c','d','e'])

Option 2:

1
2
def unusual_five():
    return len("five!")

Option 3:

1
2
def unusual_five():
    return (int(True << True << True ^ True))

Option 4:

1
2
def unusual_five():
    return "fiftyfive divided by eleven".count("e")

Test cases to validate our solution

1
2
3
4
5
6
7
8
import test
from solution import unusual_five

@test.describe("Fixed Tests")
def fixed_tests():
    @test.it('Should return 5')
    def basic_test_cases():
        test.assert_equals(unusual_five(),5,"lol")