Solution 1

def my_function(x):
    return x * 2

Guess the pattern

Use the test to guess the pattern used by the function and implement it using Python.

Test Cases

test your function - Run Test

def test_your_function():
    assert my_function(2) == 4
    assert my_function(3) == 6
    assert my_function(5) == 10
    assert my_function(9) == 18