From 96561ccbe923d9a3e8a7395897ca499f5fce18ba Mon Sep 17 00:00:00 2001 From: Elias Ojeda Medina Date: Sat, 23 May 2020 22:07:56 -0500 Subject: [PATCH] Challenge Solved --- challenge.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/challenge.py b/challenge.py index 93a85f8..e812809 100644 --- a/challenge.py +++ b/challenge.py @@ -74,11 +74,13 @@ def run(): - all_python_devs = # Using filter, generate a list with all the python devs - all_Platzi_workers = # Using filter, generate a list with all the Platzi workers - adults = # Using filter, generate a list with all people over 18 years old - workers = # Using map, generate a new list of people with a key 'homeless' with True or False values, if 'organization' have something or not - old_people = # Using map, generate a new list of people with a key 'old' with True or False values, if 'age' is greater than 30 or not + all_python_devs = list(filter(lambda x: x['language'] == 'python', DATA)) + all_Platzi_workers = list( + filter(lambda x: x['organization'] == 'Platzi', DATA)) + adults = list(filter(lambda x: x['age'] > 18, DATA)) + workers = list( + map(lambda x: (x, {'homeless': x['organization'] != ''}), DATA)) + old_people = list(map(lambda x: (x, {'old': x['age'] > 30}), DATA)) print('Python devs: ') for dev in all_python_devs: