Print exception only

Report a typo

Rearrange the lines of code below so that they form a valid script in Python.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                try:
              
                print([exception for exception in traceback.format_exception_only(type(e), e)])
              
                print([(people[person]['age'], people[person]['status']) for person in people])
              
                import traceback
              
                except Exception as e:
              
                people = {"alice": {"age": 19, "status": "away"}, "cristian": {"ag": 45, "status": "relaxed"}}
              
___

Create a free account to access the full topic