How would I make every other thing in a list in a different variable list?

The*_*gri 1 python python-3.x python-3.7

I am trying to make it so that every even thing in a list goes to one variable, and every odd one goes to another. For example, let's say x = ["a", "b", "c", "d"]. How would I make y = ["a", "c"] and z = ["b", "d"]?

I have not made any script with this yet, but I will in the future

U10*_*ard 6

你的意思是:

>>> y, z = x[::2], x[1::2]
>>> y
['a', 'c']
>>> z
['b', 'd']
>>> 
Run Code Online (Sandbox Code Playgroud)