>>> l = ['1', '32', '523', '336']
>>> [ x for x in l if "2" not in x ]
['1', '336']
>>> [ x for x in l if "2" in x ]
['32', '523']
strings_with_substring = [string for string in strings if substring in string]
my_list = input("Enter your list splited by ',': ").split(',')
i = 0
while i < len(my_list):
if my_list[i].isnumeric() == False:
my_list.remove(my_list[i])
i -= 1
i += 1
print("List without str type: ",my_list)