You just want to drop the last two characters?  Slice it.

>>> s = "080829-7_A"[:-2]
>>> print s
080829-7

- Adam

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
Behalf
> Of Ahmed, Shakir
> Sent: Wednesday, September 10, 2008 10:22 AM
> To: python-list@python.org
> Subject: removing text string
> 
> I need to remove text string from the list of the numbers mentioned
> below:
> 
> 080829-7_A
> 070529-5_c
> 080824-7_O
> 070405_6_p
> 
> The output will be : 080829-7
>                      070529-5
>                        080824-7
>                      070405-6
> 
> Any idea is highly appreciated.
> 
> 
> 
> --
> http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to