On 03/08/16 00:30, Alan Gauld via Tutor wrote: >> if item == item.lower():
I meant to add that the string islower() method is probably more readable: if item.islower() Also that you could use a list comprehension to do this without converting to a list initially: def conveert(text): result_list = [ch.upper() if ch.islower() else ch.lower() for ch in text] return ''.join(result_list) -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor