I think i am fine with the code inside the function but i would like to work with my input.
I know that raw_input() give me a string, until now the only way to make it become a list is the .split() built-in that i just learned, but i don't know well how it works or did some kind of mistake because i read that not all arguments are converted. What i can do? i need a list for make this function work
Traceback (most recent call last):
File "python", line 15, in
File "python", line 4, in purify
TypeError: not all arguments converted during string formatting
def purify (numbers): pair= for n in numbers: if n%2==0: pair.append(n) return pair print ' Erase the Odd Numbers' print'' print'Inserire una lista di numeri' numbers = raw_input('- ') numbers = numbers.split() print ' ' print purify(numbers)