[7 kyu] Categorize New Member
Question
Sample Tests
My Answer (accpected)
def open_or_senior(data):
categorize = []
for (age, handicap) in data:
if age >= 55 and handicap > 7:
categorize.append("Senior")
else:
categorize.append("Open")
return categorize
Suggested Answer
def openOrSenior(data):
return ["Senior" if age >= 55 and handicap >= 8 else "Open" for (age, handicap) in data]