Answers for "get all integers from list python"

1

python filter list of int and strings

def filter_list(l):
  'return a new list with the strings filtered out'
  return [i for i in l if not isinstance(i, str)]
Posted by: Guest on December-02-2020
0

print only strings in list python

list1 = [1, 'string', 2, 'string2']
for ele in list1:
    if(type(ele) == str):
        print(ele)
Posted by: Guest on May-14-2020

Code answers related to "get all integers from list python"

Python Answers by Framework

Browse Popular Code Answers by Language