Answer the question
In order to leave comments, you need to log in
How can this Python code be simplified?
There is a code:
for player in players:
if player["id"] == user_id: return player
else: return False
return [d for d in players if d["id"] == user_id]
, but then it returns not False, but an empty array. It would be desirable that if if does not work returned False.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question