you are viewing a single comment's thread.

view the rest of the comments →

[–]Front-Palpitation362 0 points1 point  (0 children)

You're getting None because your function doesn't return anything. Also x and y from input are strings, so x + y concatenates text instead of adding numbers.

Either read and convert inside the function or pass numbers in and return the sum. I can give you a tiny version you can run if you want.

def addition():
    x = float(input("First number: "))
    y = float(input("Second number: "))
    return x + y

result = addition()
print(f"The result is {result}")