I have this question that I've been trying to solve for the past hour but i've been getting it wrong, can someone help me?

Question:
Create a list of the odd numbers between 1 and n (include 1 as well as n -- if it's odd-- in the list). Associate the list with the variable odds .

My code:
odds = [1]
i = 0
for i <= n:
if i%2 != 0:
odds.append(i)
i+= 1

#Find odd numbers
def odd_find(fr, to):
if fr > to:
trans = fr
fr = to
to = trans
odd = []
noOdd = []
for x in range(fr, to):
if x % 2 == 0:
odd.append(x)
else:
noOdd.append(x)
print 'Odd Stuff', odd
print 'Not odd', noOdd
odd_find(5,40 )

We do not know context of your studies to know the purpose of this exersise. The purpose surely is not the correct output which can be directly produced with basic functions.