NON-HOMEWORK
I have list of floats x, and I want to turn it into list y, a list of all the tenth elements in x.
For my own reasons, I really want to do this in a tiny amount of lines. I came up with something like this:
i = 0
y = filter(lambda x: (++i)%10; x)
Theoretically this should work, i is already defined, and the ++i would typically add one to variable i, then go about the expression.
Unfortunately, ++ doesn't exist in Python.
Any Pythonic ways to go about this?
Another idea I had was to use a map, and have the expression push elements onto list y.
Let me know if I can be more clear.