Why do I get an IndentationError from a properly indented function (following a “try” with no “except”)? [duplicate]
It’s because you have: def first_function(x): try: return do_something_else() without a matching except block after the try: block. Every try must have at least one matching except. See the Errors and Exceptions section of the Python tutorial.