"jonathan wallis" <mindboggle...@gmail.com> wrote
i have a duel loop that looks like this
while y > 0 and x > 0:

This is not any kind of loop its a while expression.
It should have a body and that would then constitute a single while loop not a dual loop ( a duel lop has something to do with repeatedly settling matters of honor! :-)

i cant figure out if there is a way to make so if one loop ends it says something different than if the other loop ends.

I'm not certain what you mean by that but I assume you mean you want to determine which variable went out of bounds?

If so you can use the else clause of a while loop:

while x > 0 and y > 0:
    choice = raw_input('x or y?')
    if choice == 'x': x = 0
    else: y = 0
else:
   if x <= 0: print 'it was x'
   else: print 'it was y'


HTH,


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/

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

Reply via email to