ret_0

get_inductees

May 8th, 2022
787
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. def get_inductees(names: list, birthday_years: list, genders: list) -> dict:
  2.  
  3.     count = len(names)
  4.     inductees = []
  5.     corrupted = []
  6.  
  7.     for i in range(count):
  8.  
  9.         if genders[i] is None and birthday_years[i] is None:
  10.             corrupted.append(names[i])
  11.             continue
  12.  
  13.         if genders[i] is not None:
  14.             if genders[i] == 'Male':
  15.                 if birthday_years[i] is not None:
  16.                     if 2021 - birthday_years[i] == 18:
  17.                         inductees.append(names[i])
  18.                         continue
  19.                 else:
  20.                     corrupted.append(names[i])
  21.                     continue
  22.  
  23.         if birthday_years[i] is not None:
  24.             if 2021 - birthday_years[i] == 18:
  25.                 if genders[i] is not None:
  26.                     if genders[i] == 'Male':
  27.                         inductees.append(names[i])
  28.                         continue
  29.                 else:
  30.                     corrupted.append(names[i])
  31.                     continue
  32.  
  33.     return {
  34.         'inductees': inductees,
  35.         'corrupted': corrupted
  36.     }
Advertisement
Add Comment
Please, Sign In to add comment