How can I remove the dot separator from formatted numbers? I'm getting a list from a website by using regular expression:
a = [10.000, 20.000, 25.000]
How can I change them to a = [10000, 20000, 25000]? (They're integers now).
I am assuming what you have are strings, since you got them from a website, they should be text at first
>>> a=["10.000","20.000","25.000"]
>>> [ i.replace(".","") for i in a ]
['10000', '20000', '25000']
Use replace as this:
mystring.replace('.', '')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With