How "return" no return ?

Fredrik Lundh fredrik at pythonware.com
Thu May 12 13:35:02 EDT 2005


"Ximo" wrote:

> I am doing a interpret of lines and it show me a prompt, and I want if I
> write a declaration as "int a" my progrtam return de prompt and nothing
> more, for exemple:
>
> >>> 2+2
> 4
> >>> int a
> >>>
>
> Then I'm finding that de function which execute "int a" return me nothing,
> and no
>
> >>> int a
> None
> >>>

what Python version are you using?  here's what a normal Python
interpreter is supposed to do with your example:

>>> 2+2
4
>>> int a
  File "<stdin>", line 1
    int a
        ^
SyntaxError: invalid syntax
>>>

</F>






More information about the Python-list mailing list