Respuesta :

def Add(a, b):
    return a+b

Following are the method program to the given question:

Program Explanation:

  • Defining a method "add" that takes two integer variables "a,b" in the parameter.
  • Inside the method, a return keyword is used that adds and return parameter value.
  • Outside the method, two integer variable "a, b" is defined that use int with the input method to input value.
  • After input value, a print method is defined that calls the method and prints its calculated value with the message.

Program:

def add(a,b):#defining a method add that takes two parameter  

   return a+b#using return keyword that adds parameter value

a=int(input("Enter first number: "))#defining integer variable a that inputs value

b=int(input("Enter second number: "))#defining integer variable b that inputs value

print('Sum: ',add(a,b))#using print method that calls method and prints its calculated value with message

Output:

Please find the attached file.

Learn more:

brainly.com/question/13314892

Ver imagen codiepienagoya
ACCESS MORE