How to remove the letters (all non-numeric) from a string in Python

1 Answer

0 votes
s = '123python 98348programing 92389232language'

s = ''.join(c for c in s if c.isdigit())

print(s)

'''
run:

1239834892389232

'''

 



answered Jan 30, 2017 by avibootz

Related questions

1 answer 187 views
2 answers 186 views
2 answers 282 views
2 answers 268 views
...