๐ Beginning Python Programming / Module: List & Collection
List comprehension
๐ Beginning Python Programming / List & Collection / List comprehension
scores = [34, 65, 45, 67, 78, 56, 80] passed_scores = [x for x in scores if x >= 60] print(passed_scores) # Result: # [65, 67, 78, 80]