Remove strings from a list that contains numbers in python -


this question has answer here:

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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -