# Function to add two numbers
def add_numbers(num1, num2):
    """
    This function takes two integers and returns their sum.
    """
    return num1 + num2

# Try to get input from the user
try:
    # Ask for the first number
    first_number = int(input("Enter the first integer: "))
    
    # Ask for the second number
    second_number = int(input("Enter the second integer: "))

    # Calculate the sum using the function
    result = add_numbers(first_number, second_number)

    # Output the result
    print(f"The sum of {first_number} and {second_number} is {result}")

# Handle cases where the input isn't a valid integer
except ValueError:
    print("Invalid input. Please enter valid integers.")


The sum of 1 and 4 is 5