Path: csiph.com!pasdenom.info!from-devjntp Message-ID: JNTP-Route: nemoweb.net JNTP-DataType: Article Subject: Re: Panne de =?UTF-8?Q?m=C3=A9moire=20avec=20list=20et=20str?= References: Newsgroups: fr.comp.lang.python JNTP-HashClient: cectWLzk043CBySdtITM7ugnpxM JNTP-ThreadID: vik35m$393an$1@dont-email.me JNTP-Uri: https://www.nemoweb.net/?DataID=bhequeEQ359dhpvLYkBXKzpG_cQ@jntp User-Agent: Nemo/1.0 JNTP-OriginServer: nemoweb.net Date: Mon, 02 Dec 24 22:17:08 +0000 Organization: Nemoweb JNTP-Browser: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0 Injection-Info: nemoweb.net; posting-host="5b4a1be79effc05762607ed9b2da5480c7183194"; logging-data="2024-12-02T22:17:08Z/9126875"; posting-account="190@nemoweb.net"; mail-complaints-to="julien.arlandis@gmail.com" JNTP-ProtocolVersion: 0.21.1 JNTP-Server: PhpNemoServer/0.94.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-JNTP-JsonNewsGateway: 0.96 From: Python Xref: csiph.com fr.comp.lang.python:4242 Le 02/12/2024 à 16:32, Dominique a écrit : > Le 02/12/2024 à 12:16, Python a écrit : > >>>>> l = [['2'], ['2'], ['6'], ['8'], ['9']] >>>>> ''.join(x for x, in l) >> '22689' >> > > Je te remercie pour cette réponse qui allie simplicité et élégance. Je > me pose toute fois une question : pour quoi la virgule après le X du for de > > res=''.join(x for x, in result) > > Et si je le supprime, j'ai cette erreur : > > sequence item 0: expected str instance, list found _>>> a = ['4'] _>>> type(a) _ _>>> a, = ['4'] _>>> type(a)