Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_inductees(names: list, birthday_years: list, genders: list) -> dict:
- count = len(names)
- inductees = []
- corrupted = []
- for i in range(count):
- if genders[i] is None and birthday_years[i] is None:
- corrupted.append(names[i])
- continue
- if genders[i] is not None:
- if genders[i] == 'Male':
- if birthday_years[i] is not None:
- if 2021 - birthday_years[i] == 18:
- inductees.append(names[i])
- continue
- else:
- corrupted.append(names[i])
- continue
- if birthday_years[i] is not None:
- if 2021 - birthday_years[i] == 18:
- if genders[i] is not None:
- if genders[i] == 'Male':
- inductees.append(names[i])
- continue
- else:
- corrupted.append(names[i])
- continue
- return {
- 'inductees': inductees,
- 'corrupted': corrupted
- }
Advertisement
Add Comment
Please, Sign In to add comment