solutions

Convert boolean to binary

Define a function convert_bool_to_binary that receives a boolean and returns
1 if it is true and 0 if it is false.

Examples:

>>> convert_bool_to_binary(True)
1
>>> convert_bool_to_binary(False)
0

Test Cases

test true value - Run Test

def test_true_value():
    assert convert_bool_to_binary(True) == 1

test false value - Run Test

def test_false_value():
    assert convert_bool_to_binary(False) == 0