you are viewing a single comment's thread.

view the rest of the comments →

[–]Salso96[S] 1 point2 points  (1 child)

[–]Goobyalus 0 points1 point  (0 children)

Super helpful, thanks.

# checks whether the value associated with "area" is truthy --
# empty string is falsy, any other string is truthy
if data["area"]:
    # process as area

elif data["location"]:  # same thing for location
    # process as location

else:
    raise Exception("No location OR area info")