SyntaxFix
Write A Post
Hire A Developer
Questions
A list comprehension is a simple approach:
j2 = [x for x in j if x >= 5]
Alternately, you can use filter for the exact same result:
filter
j2 = filter(lambda x: x >= 5, j)
Note that the original list j is unmodified.
j