On Sat, Jul 12, 2014 at 09:33:20AM +0100, Alan Gauld wrote: > 2) Better (IMHO) is to convert message to lower case (or upper if > you prefer) and only do one comparison: > > while message.lower() != 'q':
I second this advice, but with a slight modification. If you're using Python 3.3 or higher, it is better to use message.casefold rather than lower. For English, there's no real difference: py> "Hello World!".casefold() 'hello world!' but it can make a difference for non-English languages: py> "Große".lower() # German for "great" or "large" 'große' py> "Große".casefold() 'grosse' -- Steven _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor