Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41659

problem with function

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 <l.selmi@icloud.com>
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 <l.selmi@icloud.com>
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" <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" <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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3594.1363894319.2939.python-list@python.org> (permalink)
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

Show key headers only | View raw


hi all,

i wrote the following code:

def find(word, letter):
    index = 0
    while index < len(word):
        if word[index] == letter:
            return index
        index = index + 1
    return -1

if i run the program i get this error: name 'word' is not defined.  how can i solve it?

thanks!

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

problem with function leonardo selmi <l.selmi@icloud.com> - 2013-03-21 19:31 +0100
  Re: problem with function "Alex" <foo@email.invalid> - 2013-03-21 20:11 +0000

csiph-web