Remove strings from a list that contains numbers in python -
this question has answer here:
- how remove integer values list in python 8 answers
is there short way remove strings in list contains numbers?
for example
my_list = [ 'hello' , 'hi', '4tim', '342' ]
would return
my_list = [ 'hello' , 'hi']
without regex:
[x x in my_list if not any(c.isdigit() c in x)]
Comments
Post a Comment