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?

Edit
Report