title: Eliminate duplicate responses in a nested for loop
body: <p>I am working on finding a solution for my discord bot, it is written in Py, it's coded to search in game database apis for a specific player name, if found, it sends a message on discord with the server ID, this part works however now I want to add a message if the player is not found after searching all the databases, here is the code:</p>
  <pre><code>@client.command()
  async def whereis(ctx, player):  # General stats
      for element in gameIDs[&quot;IDs&quot;]:
          url0 = apiLink1 + &quot;/players/?gameId=&quot; + element
          r = requests.get(url0)
          rs = r.json()
          a = rs['teams'][0]['players']
          b = rs['teams'][1]['players']
          c = a + b
          d = rs['serverinfo']['name']
          for element1 in c:
              if element1[&quot;name&quot;] == str(player):
                  embed = discord.Embed(title=player + &quot; HAS BEEN FOUND&quot;,description=d)
                  await ctx.send(embed=embed)
                  break
              else:
                  print(&quot;not found&quot;)
  </code></pre>
  <p>The first for loop is to have every database id checked, the second for loop is to verify every database with the given player, my current solution returns a &quot;not found&quot; for every gameID instance, which I understand why, but I would only like for it to send the message once the gameIDs list has been exhausted. How would I proceed with this?</p>
  <p>Thank you all so much in advance.</p>