Python code not printing output, Function with parameters

Hello world!

The task is the following:
"create a function with three parameters that are numbers that are added together.

Call the function in main and give it values"

When i run the code it it doesn’t give me the result i expect, wich is the addition of the 3 inputs that i put in the prompt;
instead it gives me this result:
“<function sumaparametros at 0x0000000000679C10>”

The problem is when you call your function sumaparametros.
When you call it, it is expected that you pass 3 parameters there, in your case those parameters are num1, num2 and num3.

Remember, you just need to fix the piece of code inside the print

hi

you didn’t call/run the function. you need something like this “- … some_func(…) …”. it is printing address of the function on memory <…0x0000000000679C10>. you need somethin like this:

> def sumparmeters(arg1,arg2,arg3):
>     return(arg1+arg2+arg3)
> 
> num1= int(input("enter 1st int:"))
> num2= int(input("enter 2st int:"))
> num3= int(input("enter 3st int:"))

> print(sumparmeters(arg1=num1,arg2=num2,arg3=num3))

side note: the first print is redundant. and function returns “None” at the moment. so I’ve changed/added return.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.