You can condense these two try blocks into something simpler, by using the `.get` method on dicts:

```python
if y.get('a', None) is not None:
  date_string = y.string
else:
  date_string = x.string
```

The second value you provide to `.get` is what you want `.get` to return if the key is not present on the dict.