[Tutor] local variable referenced before assignment

Joel Goldstick joel.goldstick at gmail.com
Thu Nov 17 20:01:41 CET 2011


On Thu, Nov 17, 2011 at 1:53 PM, <delegbede at dudupay.com> wrote:

> Post the error stack.
> Sent from my BlackBerry wireless device from MTN
>
> -----Original Message-----
> From: ADRIAN KELLY <kellyadrian at hotmail.com>
> Sender: tutor-bounces+delegbede=dudupay.com at python.org
> Date: Thu, 17 Nov 2011 18:47:07
> To: <tutor at python.org>
> Subject: [Tutor] local variable referenced before assignment
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>

  if amount>base:
        totalreturn=amount*dollar
    else:
        print 'not enough'
    return totalreturn

Notice if amount isn't more than base totalreturn is not created, so the
else clause executes and totalreturn doesn't exist


-- 
Joel Goldstick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111117/30d712a2/attachment.html>


More information about the Tutor mailing list