# Can someone tell me what is wrong with my code? (This was solved! Yay!)

I just started python like 2 or 3 months ago so please use newbie stuff thanks! I am trying to make a code that you can input numbers into and the program will create two individual lists that say the even numbers and the odd numbers that the user inputted.
This is my code:

``````allnums = []
evennums = []
oddnums = []

print ("How many numbers would you like to enter into this program?")
amountofnumbers = int(input())
print ()

for count in range (0,amountofnumbers) :
number1 = int(input("Enter your number:  "))
allnums.append(number1)

if allnums % 2 == 0 :
evennums.append()
else:
oddnums.append()

lengtheven = len(evennums)
lengthodd = len(oddnums)
print ("These are your even numbers!")
for count in range(0, lengtheven):
print(evennums[count])

print ("These are your odd numbers!")
for count in range(0, lengthodd):
print(oddnums[count])
``````

Did you look at the error message you got?
Youâ€™re trying to get the modulo (%) of a list, where you want to get the modulo of a list element.
Move

``````if allnums % 2 == 0 :
evennums.append()
else:
oddnums.append()
``````

one indent to the right so that i gets executed in the course of the loop and replace `allnums` with `number1`.

By the way, instead of calculating the lenght of a list and iterating over the indexes you can also iterate over the list itself, e.g.
`for num in evennums:`

There are a couple of problems. This first is that the `if` statement must be within the `for` loop. The second is that when checking the values of the list you need subscripts as follows:

``````allnums = []
evennums = []
oddnums = []

print ("How many numbers would you like to enter into this program?")
amountofnumbers = int(input())
print ()

for count in range (0,amountofnumbers) :
number1 = int(input("Enter your number:  "))
allnums.append(number1)

if allnums[count] % 2 == 0 :
evennums.append(number1)
else:
oddnums.append(number1)

lengtheven = len(evennums)
lengthodd = len(oddnums)
print ("These are your even numbers!")
for count in range(0, lengtheven):
print(evennums[count])

print ("These are your odd numbers!")
for count in range(0, lengthodd):
print(oddnums[count])
``````

I hope this helps

Thank you so much!