while loop - multiple condition

Shiva shivaji_tn at yahoo.com
Sun Oct 12 19:08:00 CEST 2014

Why is the second part of while condition not being checked?

while ans.lower() != 'yes' or ans.lower()[0] != 'y':
     ans = input('Do you like python?')

My intention is if either of the conditions are true the loop should break.
But the condition after 'or' doesn't seem to evaluate.


More information about the Python-list mailing list