Asking about how to write the code

This is a PRACTICE question. Define the function sum2(...) which receives two integer numbers n1 and n2 as parameters and it returns the sum of those numbers.
As an example, the following code fragment:
res = sum2(2,5)
print (res)
should produce the output:

You are viewing a single comment. View All
JoshDaBosh (77)
def sum2(n1, n2):
    return int(n1)+int(n2)

@JoshDaBosh Why it didn't works

n1 = int(input("Put a integer number"))
n2 = int(input("Put another integer number"))
def sum2(n1, n2):
return n1 + n2

JoshDaBosh (77)

@TZLALA you didn't call the function and didn't indent properly