← Back to challenges

Filter Strings from Array

PythonHardconditionsloopsstringsarrays

Instructions

Create a function that takes a list of strings and integers, and filters out the list so that it returns a list of integers only.

Examples

filter_list([1, 2, 3, "a", "b", 4]) ➞ [1, 2, 3, 4]

filter_list(["A", 0, "Innokodakademija", 1729, "Python", "1729"]) ➞ [0, 1729]

filter_list(["Nothing", "here"]) ➞ []

Notes

Don't overthink this one.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Invert Colors