Heiko Wundram wrote: > Am Freitag, 27. Mai 2005 13:31 schrieb Michael: > >>if(C == 'z') C='a'; >>else C++; > > > if C == "z": > C = "a" > else: > C = chr(ord(C)+1) > According to the OP's problem (with the assumption that only characters from a-z are given) he might even try a lil LC: >>> s = "shiftthis" >>> ''.join([chr(((ord(x)-ord('a')+1)%26)+ord('a')) for x in s]) 'tijguuijt'
HTH, Wolfram -- http://mail.python.org/mailman/listinfo/python-list