KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
my dict looks like d = { 'name': 'name', 'date': 'date', 'amount': 'amount', ... } I want to test if name and amount exists, so I will do if not `name` in d and not `amount` in d: raise ValueError # for example Suppose I get the data from an api and I want to test if 10 of the fields exists in the dictionary or not. Is it still the best way to look for?
Tags (comma-separated)
Save Edits
Cancel