11 lines
247 B
Python

try:
x = input("Give me a number: ")
x = int(x)
y = input("Give me another number: ")
y = int(y)
except ValueError:
print("Sorry, I really needed a number.")
else:
sum = x + y
print(f"The sum of {x} and {y} is {sum}.")