I need output for below input data using python 2.7
Asked
Active
Viewed 50 times
-8
-
1Please copy the code to your question in a [code snippet](https://stackoverflow.com/help/formatting). If the link of that image ever changes, the value of your question disappears. – Virginia Dec 21 '18 at 11:00
-
i have added script in image – Girish B Dec 21 '18 at 11:08
1 Answers
0
This should work for you:
import re
your_string = "reth10.890"
number = re.findall("\d+\.\d+", your_string)
requested_string = re.sub(number[0], '', a)
print(requested_string)
>>>'reth'
If your string contains more floats you have to select the last one in number

dl.meteo
- 1,658
- 15
- 25