On 22 Mar 2006 13:07:33 -0800 "Byte" <[EMAIL PROTECTED]> wrote: > The following code will not work for me: > > x = 1 > > while x == 1: > print 'hello' > x = input('What is x now?: ') > > while x == 2: > print 'hello again' > x == input('What is x now?: ') > > The second loop dose not seem to be able to activate the > loop above it.... > Proof from my command line: > > $ python program-that-dose-not-work.py > hello > What is x now?: 2 > hello again > What is x now?: 1 > hello again > What is x now?: > > So, now I ask you: how do I make it work?
Curious. What did you expect it to do, and what sort of experience made you think it ought to do that? It seems like anyone who had ever seen an Algol-derived programming language would expect exactly what happens, and I think so would a "naive" user. My impression is that you imagine you are writing "rules" instead of a "program". That's such an odd expectation, I am curious what led you to think that way. Do you have prior experience with inference engines or something? Jordan Greenberg has already answered your actual question, so I won't repeat. :-) Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list