[Tutor] hi...

Alberto Perez betopm at live.com.mx
Sun Aug 24 08:31:28 CEST 2008


I have a problem with python, I'm begginner in python. How clear the screen of GUI python interactive???? and which is the difference between interactive mode and not interactive mode???? because when I run a program in interactive mode, the program run very good, but if run in not interactive mode not show me error, but the return of function returns no value, this is the source code:
 
def suma(no1,no2):    total=no1+no2    return total
print 'hola'opcion=input()if opcion==1:    print 'suma'    a=input()    b=input()    suma(a,b)
 
the result of this code is:
 
hola1suma57>>> totalTraceback (most recent call last):  File "<pyshell#0>", line 1, in <module>    totalNameError: name 'total' is not defined>>> 
 
why this happens??? what I did wrong??? and why run very good in interactive mode??? thanks for help me and sorry for my bad english, I from Mexico and I english student. Thank you.
_________________________________________________________________
Juega y gana, tenemos 3 Xbox a la semana.
http://club.prodigymsn.com/ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080824/5a36675b/attachment.htm>


More information about the Tutor mailing list