Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!gordon From: John Gordon Newsgroups: comp.lang.python Subject: Re: Why does 'as' not recognized? Date: Thu, 12 Nov 2015 17:24:32 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 22 Message-ID: References: <8ddbc8fd-ebdb-4cd2-8e3b-b0e1f5142e76@googlegroups.com> NNTP-Posting-Host: panix1.panix.com X-Trace: reader1.panix.com 1447349072 24240 166.84.1.1 (12 Nov 2015 17:24:32 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Thu, 12 Nov 2015 17:24:32 +0000 (UTC) User-Agent: nn/6.7.3 Xref: csiph.com comp.lang.python:98708 In <8ddbc8fd-ebdb-4cd2-8e3b-b0e1f5142e76@googlegroups.com> fl writes: > >>> cats = ['Tom', 'Snappy', 'Kitty', 'Jessie', 'Chester'] > >>> > >>> type(cats) > > >>> cats[2] > 'Kitty' > >>> as=cats[2] > SyntaxError: invalid syntax > >>> as=cats > SyntaxError: invalid syntax > >>> as > SyntaxError: invalid syntax 'as' is a python language keyword, and cannot be used for variable names. -- John Gordon A is for Amy, who fell down the stairs gordon@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies"