Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'error:': 0.05; 'defined.': 0.09; 'sfxlen:2': 0.10; 'def': 0.10; 'index': 0.13; 'letter:': 0.16; 'to:name:python-list@python.org': 0.20; 'all,': 0.21; 'subject:problem': 0.22; 'cc:2**0': 0.23; 'cc:addr:python.org': 0.25; 'wrote': 0.26; 'thanks!': 0.26; 'run': 0.28; 'to:addr :python-list': 0.33; 'code:': 0.33; 'received:17': 0.35; 'subject:with': 0.36; 'charset:us-ascii': 0.36; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'solve': 0.62 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8626,1.0.431,0.0.0000 definitions=2013-03-21_06:2013-03-21, 2013-03-21, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=3 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1302030000 definitions=main-1303210140 From: leonardo selmi Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable Subject: problem with function Date: Thu, 21 Mar 2013 19:31:47 +0100 To: "python-list@python.org" MIME-version: 1.0 (Mac OS X Mail 6.2 \(1499\)) X-Mailer: Apple Mail (2.1499) Cc: "help@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1363894319 news.xs4all.nl 6922 [2001:888:2000:d::a6]:56763 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41659 hi all, i wrote the following code: def find(word, letter): index =3D 0 while index < len(word): if word[index] =3D=3D letter: return index index =3D index + 1 return -1 if i run the program i get this error: name 'word' is not defined. how = can i solve it? thanks!=