Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def openOrSenior(data):
- # Hmmm.. Where to start?
- #senior age >=55, handicap >7 (-2 >= range <=+26)
- output_list = []
- print(data)
- for element in data:
- print('age - {}, handi - {}'.format(element[0], element[1]))
- if element[0] >=55 and element[1] > 7:
- output_list.append("Senior")
- else:
- output_list.append("Open")
- print(output_list)
- return output_list
- ##Run
- openOrSenior([[45, 12],[55,21],[19, -2],[104, 20]]
- ##expected
- ['Open', 'Senior', 'Open', 'Senior']
- ##Output
- ['Open']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement