Construct a Python script to find the sum of all odd numbers between 1 to n.
n=10
def sum_odd_numbers(n):
    sum = 0
    for i in range(1,n+1):
        if i % 2 != 0:
            sum += i
    return sum

odd_sum = sum_odd_numbers(10)
print(odd_sum)