solutions

Knock 3 times

Modify the while loop in the function knock_three_times to print the string 'Knock Knock' three times.

Test Cases

test knock three times - Run Test

def test_knock_three_times():
    with CaptureOutput() as output:
        knock_three_times()

    assert len(output) == 3
    assert output == [
        'Knock Knock',
        'Knock Knock',
        'Knock Knock'
    ]