basically I'm just parsing a JSON file containing informations about several movies and save some of them in a different dictionary for later use
example: not all movies have a description, I'm using a try/except to handle the "keyError" that appears when there is no description in the json, is there a better way to do it?
for movie in json:
# other entries
try:
description = {"description": movie_details['Description']}
except KeyError:
description = {"description": ""}
# other entries
try:
other_value = {"other_value": movie_details["other_value"]
except KeyError:
other_value = {"other_value": ""}
this seems to me very "dirty", if you have some tip to write a cleaner code would be awesome
Thanks