question

John Henderson jhenRemoveThis at talk21.com
Thu May 29 18:14:17 EDT 2008


Gandalf wrote:

> how do i write this code in order for python to understand it
> and print me the x variable
> 
> x=1
> def aaaa():
>     x++
>     if x > 1:
>         print "wrong"
>     else :
>         print x
> 
> aaaa()

Example:

x=1
def aaaa(x):
    x += 1
    if x > 1:
        return "wrong"
    else :
       return x

print aaaa(x)


John



More information about the Python-list mailing list