in understanding while loop someone should understand "if conditional" first.

In "If conditional" there are common relational symbol "and" and "or"
Let's discuss  "and" conditional
Condition 1     Condition 2              Result
True                True                        True
True                False                      False
False              True                        False
False              False                      False

In short, and equal True if and only if both condition are true.

"If the while loop result condition  is true it will execute its block."

example:

x = 1
y = 1

while x==1 and y==1:
     # it will be processed if x==1 and y==1 are both true, in this case it is!




another example:
x=1
y=2

while x==1 and y==1:
     # it will be processed if x==1 and y==1 are both true, in this case it is not!


Hope this help!
pujo



On 1/15/06, John Joseph <[EMAIL PROTECTED]> wrote:
Hi
   I am trying to use "while" loop  , here I want
while loop to check for two conditions , I  am not
getting an idea  how to use "while" loop for  checking
two conditions
                I  used "&" condition , but it is not
giving me the expected results
        I used in this way

             while (condition no 1) & (condition no2):
                print "Results"

         I request guidance
                Thanks
                     Joseph John




___________________________________________________________
NEW Yahoo! Cars - sell your car and browse thousands of new and used cars online! http://uk.cars.yahoo.com/
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to