A missing iterator on itertools module?

Liste des GroupesRevenir à cl python 
Sujet : A missing iterator on itertools module?
De : none (at) *nospam* none.fr (ast)
Groupes : comp.lang.python
Date : 28. Mar 2024, 18:45:42
Autres entêtes
Organisation : Guest of ProXad - France
Message-ID : <66059eb6$0$7522$426a34cc@news.free.fr>
User-Agent : Mozilla Thunderbird
Hello
Suppose I have these 3 strings:
s1 = "AZERTY"
s2 = "QSDFGH"
s3 = "WXCVBN"
and I need an itertor who delivers
A Q W Z S C E D C ...
I didn't found anything in itertools to do the job.
So I came up with this solution:
list(chain.from_iterable(zip("AZERTY", "QSDFGH", "WXCVBN")))
['A', 'Q', 'W', 'Z', 'S', 'X', 'E', 'D', 'C', 'R', 'F', 'V', 'T', 'G', 'B', 'Y', 'H', 'N']
Do you havbe a neat solution ?

Date Sujet#  Auteur
28 Mar 24 * A missing iterator on itertools module?9ast
28 Mar 24 +- Re: A missing iterator on itertools module?1ast
28 Mar 24 +* Re: A missing iterator on itertools module?5Stefan Ram
28 Mar 24 i`* Re: A missing iterator on itertools module?4ast
28 Mar 24 i `* Re: A missing iterator on itertools module?3Stefan Ram
29 Mar 24 i  +- Re: A missing iterator on itertools module? (Posting On Python-List Prohibited)1Lawrence D'Oliveiro
29 Mar 24 i  `- Re: A missing iterator on itertools module?1Mark Bourne
3 Apr 24 +- Re: A missing iterator on itertools module?1Antoon Pardon
3 Apr 24 `- Re: A missing iterator on itertools module?1<avi.e.gross

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal