I'm trying to delete all digits from a string.
However the next code deletes as well digits contained in any word, and obviously I don't want that.
I've been trying many regular expressions with no success.
s = "This must not b3 delet3d, but t...
If I want to find the sum of the digits of a number, i.e. :
Output: 14, which is (9 + 3 + 2)
What is the fastest way of doing this?
I instinctively did:
sum(int(digit) for digit in str(number))
and I found this online: