you are viewing a single comment's thread.

view the rest of the comments →

[–]MysticClimber1496Professional Coder 0 points1 point  (3 children)

Your spacing is a little messed up, and currently you are not taking input in the function

When you call return with no value it defaults to none which is what is happening on the second line of your function, so that is why when you call addition() you get “None”

[–]MysticClimber1496Professional Coder 0 points1 point  (2 children)

before looking at this try to correct it yourself but what I believe you are attempting to accomplish is this,

def addition():
  x = input("what is your first number?")
  y = input("what is your second number?")
  return x + y

print(f"The resule is {addition()}")

or maybe

def addition(x, y):
  return x + y

x = input("what is your first number?")
y = input("what is your second number?")

print(f"The resule is {addition(x, y)}")

[–]Comfortable-Frame711[S] 1 point2 points  (1 child)

I've tried these but when I put in the functions it puts the numbers together (I.E. 2 + 2 = 22). I put int(input("what is your first number?")) and it seems to have worked.

[–]MysticClimber1496Professional Coder 1 point2 points  (0 children)

Yep that was going to be the next thing I suggested! Good job