Change number to odd

Define a function make_number_odd that receives a number, adds 1 to that
number if it is even, and returns the number.

If the original number passed is odd, just return it.

Hint: Use the % operator to determine if even or odd


>>> make_number_odd(2)
>>> make_number_odd(5)

Test Cases

test even number - Run Test

def test_even_number():
    assert make_number_odd(2) == 3

test odd number - Run Test

def test_odd_number():
    assert make_number_odd(5) == 5

Solution 1

def make_number_odd(number):
    if number % 2 == 0:
        number += 1
    return number
def make_number_odd(number): pass