try: result = 10 / int('a') except ValueError: print("10", end="#") else: print("20", end="#") finally: print("30", end="#")
10#30#
10#
20#
30#