This?
lista = [1, 2, 3, 4, 5]
a, b, c, d, e = lista
Behold working in the ideone. And in the repl it.. Also put on the Github for future reference.
You can do it with the tuple mechanism, where you can define variables in sequence and the list will automatically population them. Of course, you need to match the number of elements with the number of variables, otherwise some elements will not enter the variables or some variables will be worthless.
This almost always makes no sense and does not bring advantages. A variable accessed by your index is still a variable. Especially a variable like the same differentiated name only a sequential number shows that it is the wrong option. In very few cases where an API works one way and there is a lot of advantage in another way is that it should do this.
Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful to you. You can also vote on any question or answer you find useful on the entire site.
– Maniero