# prompt: python program to take 2 numbers and give the addition
# prompt: python program to take 2 numbers and give the addition
def add_numbers(x, y):
"""Adds two numbers and returns the sum."""
return x + y
# Get input from the user
num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))
# Calculate the sum
sum_result = add_numbers(num1, num2)
# Print the result
print(f"The sum of {num1} and {num2} is: {sum_result}")
Comments
Post a Comment