How can I write a program to add two numbers using functions in python?

0 votes
Is there a built-in function to add numbers?
May 16, 2019 in Python by Waseem
• 4,540 points
10,455 views

2 answers to this question.

0 votes
def add(a,b):

     return a + b

#when i call this function with arguments it will print the addition of the two numbers

print(add(10,15))
answered May 20, 2019 by Mohammad
• 3,210 points
return add ##make this changes here add function will be called
0 votes
there is sum() function as a built in for addition.
answered Oct 24 by anonymous

Related Questions In Python

+1 vote
1 answer
0 votes
1 answer

How can I define a multidimensional array in python using ctype?

Here's one quick-and-dirty method: >>> A = ((ctypes.c_float ...READ MORE

answered Oct 9, 2018 in Python by aryya
• 7,400 points
1,292 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,570 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,800 points
1,190 views
0 votes
1 answer

how do I check the length of an array in a python program?

lets say we have a list mylist = ...READ MORE

answered Mar 12, 2019 in Python by Mohammad
• 3,210 points
253 views
0 votes
1 answer

How can I find the square of a number in python?

You can use the exponentiation operator or ...READ MORE

answered May 20, 2019 in Python by Mohammad
• 3,210 points
158 views