A Thursday 23 April 2009, Nils Wagner escrigué:
> Hi all,
>
> How can I obtain the position of the minus sign within the
> following string ?
>
> >>> liste[1]
>
> '1.5-te'

That's easy by using basic weaponery in Python:

In [8]: liste[1].find('-')
Out[8]: 3

In [9]: liste[1][3]
Out[9]: '-'


-- 
Francesc Alted

"One would expect people to feel threatened by the 'giant
brains or machines that think'.  In fact, the frightening
computer becomes less frightening if it is used only to
simulate a familiar noncomputer."

-- Edsger W. Dykstra
   "On the cruelty of really teaching computer science"
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to