Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Peter Otten <__peter__@web.de> Newsgroups: comp.lang.python Subject: Re: how to get the list form dictionary's values Date: Sun, 21 Feb 2016 15:06:55 +0100 Organization: None Lines: 35 Message-ID: References: <554c09f2-6a6b-4576-9c9d-50d6234c8583@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: news.uni-berlin.de 5w0IX2drrkCzR5lGhQ/prgtyUSAEC2oR+UumajnA/75w== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'repeated': 0.07; 'subject:form': 0.07; 'suffix': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'syntax': 0.13; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'received:t-ipconnect.de': 0.16; 'redundant.': 0.16; 'subject:values': 0.16; 'syntaxerror:': 0.16; 'wrote:': 0.16; 'trying': 0.22; 'seems': 0.23; 'import': 0.24; 'header:User- Agent:1': 0.26; 'subject:list': 0.26; 'header:X-Complaints-To:1': 0.26; 'idea': 0.28; 'actual': 0.28; 'looks': 0.29; 'colon': 0.29; 'question:': 0.29; 'code': 0.30; 'file': 0.34; 'to:addr:python- list': 0.36; 'subject:: ': 0.37; 'method': 0.37; 'received:org': 0.37; 'missing': 0.37; 'names': 0.38; 'end': 0.39; 'subject:the': 0.39; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'your': 0.60; 'email addr:gmail.com': 0.62; 'subject:get': 0.81 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: p57bd9414.dip0.t-ipconnect.de User-Agent: KNode/4.13.3 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:103291 davidbenny2000@gmail.com wrote: > File "mainpy.py", line 81 > for functionlistelement in functionlist0 > ^ > SyntaxError: invalid syntax > > > import asyncio [snip] > mappedfunc = {} > functionlist000 = [] > functionlist001 = [] > functionlist002 = [] > functionlist003 = [] > functionlist004 = [] [snip many names with numeric suffix and repeated method calls] I have no idea what you are trying to do; however, your code looks awfully redundant. This is errorprone: functionkey000 = {'000': f000 } functionkey001 = {'001': f001 } functionkey002 = {'002': f002 } functionkey002 = {'003': f003 } functionkey002 = {'004': f004 } > for functionlistelement in functionlist0 To answer what seems to be your actual question: a colon is missing at the end of this line.