# filter

def filter_per(p):
    return p.get('age') <= 18


persons = [
    {'name': 'Jack', 'age': 18},
    {'name': 'Rose', 'age': 16},
    {'name': 'Tom', 'age': 23}
]

rst = filter(filter_per, persons)
print('rst: ', rst)
for item in rst:
    print('item: ', item)








57bf29624485000b329ecd4fe8a64252a67e2a2b
<mask token>

def filter_per(p):
    return p.get('age') <= 18


<mask token>

def filter_per(p):
    return p.get('age') <= 18


<mask token>
print('rst: ', rst)
for item in rst:
    print('item: ', item)

def filter_per(p):
    return p.get('age') <= 18


persons = [{'name': 'Jack', 'age': 18}, {'name': 'Rose', 'age': 16}, {
    'name': 'Tom', 'age': 23}]
rst = filter(filter_per, persons)
print('rst: ', rst)
for item in rst:
    print('item: ', item)

# filter

def filter_per(p):
    return p.get('age') <= 18


persons = [
    {'name': 'Jack', 'age': 18},
    {'name': 'Rose', 'age': 16},
    {'name': 'Tom', 'age': 23}
]

rst = filter(filter_per, persons)
print('rst: ', rst)
for item in rst:
    print('item: ', item)







