Skip to content

Conversation

@ivchip
Copy link

@ivchip ivchip commented Apr 20, 2020

Challenge 07 completed and create two new functions

Copy link

@hyfi06 hyfi06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments


def get_homeless(d):
x = dict(d)
if (x['organization'] != ''):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si tiene una organización no está fijo, por lo que homeless debería ser Flase, no?

def get_homeless(d):
x = dict(d)
if (x['organization'] != ''):
x.update({'homeless': True})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x['organization'] != '' ya es booleando , pudrías usarlo directamente, sin necesidad del if

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 data: data['language'] == 'python', DATA))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si tu variable es python_devs podrías usar ne la lambda dev en lugar de data, para darle un sentido a los elementos de DATA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants