solutions

Increment Parameter by one

Write a function from scratch named increment_parameter_by_one that receives only one numeric parameter and returns that parameter incremented by one. You are in charge of writing the whole function body + definition.

The function should be used in this way:

two = increment_parameter_by_one(1)
print(two)  # 2

fifteen = increment_parameter_by_one(14)
print(fifteen)  # 15

print(increment_parameter_by_one(22))  # 23

Test Cases

test increment one by one - Run Test

def test_increment_one_by_one():
    assert increment_parameter_by_one(1) == 2

test increment seven by one - Run Test

def test_increment_seven_by_one():
    assert increment_parameter_by_one(7) == 8