Avatar ·

Delete a dictionary from the list of dictionaries

📁 lambda, List, dictionary, Advanced Python Topics

I have a list with dictionaries. Where the person's name is indicated, where and where it goes. But one dictionary has no value "from". How to delete this dictionary from the list?

tour = [
    { "name": "Alexander", "from": "Moscow", "to": "Kazan" },
    { "name": "Alice", "from": "Moscow", "to": "Kazan" },
    { "name": "Sergey", "to": ... }
]