Modify the existing Python code below so that it returns the sum of odd numbers less than the input n.
n = 10

def sum_odd_numbers(n):
    result = 0
def sum_odd_numbers(n):
    result = 0
    for i in range(n):
        if i % 2 != 0:
            result += i
    return result