Python Kopf und Schwanz in einer Linie

Gibt es eine pythonic way of packen Sie eine Liste in das erste element und den "Schwanz" in einem einzigen Befehl?

Beispiel:

>> head, tail = **some_magic applied to** [1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
>> head
1
>>> tail
[1, 2, 3, 5, 8, 13, 21, 34, 55]

InformationsquelleAutor der Frage Giacomo d'Antonio | 2012-05-10

Schreibe einen Kommentar