On 27 May 2005 10:52:36 -0400,
Dan Sommers [EMAIL PROTECTED] wrote:
And use string.ascii_letters[ 1 : ] + string.ascii_letters[ 0 ] for the
second parameter to string.maketrans.
Oops. Thank you Duncan and Rocco for correcting my mistake.
Regards,
Dan
--
Dan Sommers
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)
--
--- Heiko.
see you at: http://www.stud.mh-hannover.de/~hwundram/wordpress/
pgpC3uVPL36vD.pgp
Description: PGP signature
--
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
Michael wrote:
Hi,
I've got a string s, and i want to shift all the letters up by one, eg
a-b, b-c z-a
In c++ i can do this quite simply with
if(C == 'z') C='a';
else C++;
but i can't work out how to do this this in python??
import string
upone = string.maketrans(
Duncan Booth wrote:
Michael wrote:
Hi,
I've got a string s, and i want to shift all the letters up by one, eg
a-b, b-c z-a
In c++ i can do this quite simply with
if(C == 'z') C='a';
else C++;
but i can't work out how to do this this in python??
import string
upone =
On 5/27/05, Michael [EMAIL PROTECTED] wrote:
Hi,
I've got a string s, and i want to shift all the letters up by one, eg a-b,
b-c z-a
In c++ i can do this quite simply with
if(C == 'z') C='a';
else C++;
but i can't work out how to do this this in python??
Here's one that works
On Fri, 27 May 2005 16:10:32 +0200,
Wolfram Kraus [EMAIL PROTECTED] wrote:
Duncan Booth wrote:
import string
upone = string.maketrans(
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
'bcdefghijklmnopqrstuvwxyzaBCDEFGHIJKLMNOPQRSTUVWXYZA')
string.translate(I've got a string s,
Dan Sommers wrote:
Wolfram Kraus [EMAIL PROTECTED] wrote:
Duncan Booth wrote:
import string
upone = string.maketrans(
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
'bcdefghijklmnopqrstuvwxyzaBCDEFGHIJKLMNOPQRSTUVWXYZA')
string.translate(I've got a string s, upone)
Dan Sommers wrote:
On Fri, 27 May 2005 16:10:32 +0200,
Wolfram Kraus [EMAIL PROTECTED] wrote:
Duncan Booth wrote:
import string
upone = string.maketrans(
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
'bcdefghijklmnopqrstuvwxyzaBCDEFGHIJKLMNOPQRSTUVWXYZA')