Filtering Lists Using Comprehension

Python

 1|  original_list = [10,11,12,13]
 2|  
 3|  new_list = [n for n in original_list if n > 11]
 4|  
 5|  >> [12, 13]
Did you find this snippet useful?

Sign up for free to to add this to your code library