-1

I am coding a premium feature into my discord bot.I have looked around alot of websites and couldn't find anything.This bot is in python.

Here is what my json file looks like.I have replaced the IDs for privacy reasons.

{
    "list": [
        {
            "id": 12345
        },
        {
            "id": 1234
        },
        {
            "id": 123
        },
        {
            "id": 12
        },
        {
            "id": 1
        }
    ]
}
vinzy
  • 1
  • 2

1 Answers1

0

This maybe help

value_want_to_delete = 123
for i in dct["list"]:
    if i["id"] == value_want_to_delete:
        del i["id"]
print(dct)
Avry G.
  • 39
  • 5