try:
Contains the code that might throw an exception.
catch:
Catches and handles the exception thrown by the try block.
finally:
Executes code after try and catch, regardless of whether an exception was thrown or caught. It is typically used for cleanup activities like closing resources.