backreference

Cousin Stanley CousinStanley at HotMail.com
Sat Jan 11 16:02:03 EST 2003


Would a simple non-re version work ???

list_lines = [ 'Greetings, huMon.' ,
               'How are you today?' ,
               'I hope you are OK;' ,
               'Python rocks!' ,
               'Check the following:' ]

for xLine in list_lines :

    last_char = xLine[ len( xLine ) - 1 : ]

    xStr = xLine[ : -1 ]

    print xStr , last_char







More information about the Python-list mailing list