Sunday, February 10, 2019

Adding two integers using function

Q. Write a program in python to add two integers using function.

Solution:

Program to add two integers using function.

Code:

def sum(a,b):
return (a+b)
x = int(input('Enter first integer: '))
y = int(input('Enter second integer: '))
z = sum(x,y)
print('The sum of the numbers is:',z)

No comments: