I donä't get while-loops

Stefaan Himpe stefaan.himpe at gmail.com
Sat Aug 2 22:15:07 CEST 2008


> 
> def read2():
>     expr = ""
>     while expr != "quit":
>         expr = raw_input("Lisp> ")
>         print parse(expr)
>         read2()
^^^^^^^^^^^^^^^^^
>     print "Good session!"


You shouldn't call read2() inside read2()...
just remove that line and retry...

Each time you call read2() recursively, a
new expr is initialized to "", so the condition
never becomes true



More information about the Python-list mailing list