I'm working with APIs that split out variable keys. Right now, I deal with this using a "try" but it looks super ugly, takes up four lines and I'm sure there must be a better way.
try:
address = location['address']
except:
address = ''
I'm working with APIs that split out variable keys. Right now, I deal with this using a "try" but it looks super ugly, takes up four lines and I'm sure there must be a better way.
try:
address = location['address']
except:
address = ''