In: Computer Science
In Python Complete the oddNumbers() functions to take an int (as a parameter). Return a list of all of the odd numbers between 1 and one less than the parameter. Also, complete the evenNumbers() functions to take an int (as a parameter). Return a list of all of the even numbers between 2 and one less than the parameter.
output:
code:
def oddNumbers(n):
l=[]
for i in range(1,n):
if (i%2!=0):
l.append(i)
return l
def evenNumbers(n):
l1=[]
for i in range(2,n):
if(i%2==0):
l1.append(i)
return l1