[Tutor] How do I slice up a list of strings?

John Matthews jmatthew at columbus.rr.com
Tue Mar 23 21:35:07 EST 2004


I read in data from a log file that looks like this:

['Tue 03/23/2004 13:11:07.49 user1 \n', 'Tue 03/23/2004 13:45:07.34 user2 \n', 
'Tue 03/23/2004 13:46:13.53 user2 \n', 'Tue 03/23/2004 14:22:08.45 user3 \n', 
'Tue 03/23/2004 15:17:58.38 user4 \n']

I want to slice the stings so that the list becomes:

['user1', 'user2', 'user2', 'user3', 'user4']

How do I do that?

Thanks!
-- 
John Matthews
http://8ftarch.org

REGIME CHANGE 2004




More information about the Tutor mailing list