Path: csiph.com!weretis.net!feeder4.news.weretis.net!storethat.news.telefonica.de!telefonica.de!news.panservice.it!bofh.it!tornado.fastwebnet.it!53ab2750!not-for-mail Subject: Re: Iterazione Python References: Newsgroups: it.comp.lang.python From: Smith Message-ID: <572CF68F.2080600@smith.it> User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Lines: 30 Date: Fri, 6 May 2016 21:54:55 +0200 NNTP-Posting-Host: 93.34.176.20 X-Complaints-To: newsmaster@fastweb.it X-Trace: tornado.fastwebnet.it 1462564495 93.34.176.20 (Fri, 06 May 2016 21:54:55 CEST) NNTP-Posting-Date: Fri, 06 May 2016 21:54:55 CEST Xref: csiph.com it.comp.lang.python:7652 On 06/05/2016 17:19, Andrea D'Amore wrote: > On 2016-05-06 14:32:57 +0000, Smith said: > >> vorrei sapere perchè questo script non funziona: >> >> numbers = [1,2,3,4,5] >> letters = ["A", "B", "C"] >> for x,j in map(None,numbers,letters): >> print(x,j) > > Perché stai usando None come primo argomento di map(), quindi map cerca > di chiamare None ma questo non ha l'attributo '__call__' e quindi non è > chiamabile come funzione, infatti hai: > >> TypeError: 'NoneType' object is not callable > > Se provo con zip() : numbers = [1,2,3,4,5] letters = ["A", "B", "C"] for x,j in zip(numbers,letters): print(x,j) Non mi restituisce le due liste complete: 1 A 2 B 3 C