Python try finally block returns [duplicate]
问题 This question already has answers here : Weird Try-Except-Else-Finally behavior with Return statements (2 answers) Closed 6 years ago . There is the interesting code below: def func1(): try: return 1 finally: return 2 def func2(): try: raise ValueError() except: return 1 finally: return 3 func1() func2() Could please somebody explain, what results will return these two functions and explain why, i.e. describe the order of the execution 回答1: From the Python documentation A finally clause is