Kent Johnson wrote: > Ricardo Aráoz wrote: > >> _validChars = { >> 'X' : >> 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' >> , '9' : '1234567890' >> , '-' : '-1234567890' >> , 'A' : >> 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' >> , '!' : 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'} >> _validKeys = _validChars.keys() > > <snip> >> while maskChar not in _validKeys : > > There is no need to make _validKeys, you can write > while maskChar not in _validChars > which is actually more efficient, in general, because it is a hash table > lookup instead of searching a list. > > Kent >
Thanks Kent, I'll wait to see if there are more corrections and re-post the corrected code. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor