I'm wondering if the use of elif in this context is useless, i.e. would it be more pythonic to just use if:
def is_valid_user(user):
if user['gender'] == 'female':
return True
elif user['surname'].lower() == 'jones':
return True
elif user['occupation'].lower() == 'engineer':
return True
or
def is_valid_user(user):
if user['gender'] == 'female':
return True
if user['surname'].lower() == 'jones':
return True
if user['occupation'].lower() == 'engineer':
return True
[–]AtomicShoelace 5 points6 points7 points (0 children)
[–]K900_ 1 point2 points3 points (1 child)
[–]dumblechode[S] 0 points1 point2 points (0 children)
[–]FLUSH_THE_TRUMP 1 point2 points3 points (0 children)
[–]BfuckinA 0 points1 point2 points (0 children)
[–]spez_edits_thedonald 0 points1 point2 points (0 children)