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
23,863 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))

Hope this will help!

If you need to know more about Python, join Python certification course online today.

Thanks!

answered May 21, 2019 by Mohammad
• 3,230 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 25, 2020 by anonymous

Related Questions In Python

+1 vote
1 answer
0 votes
1 answer

How can I add new keys to a dictionary in Python?

Yes, it is possible to add new ...READ MORE

answered Feb 9, 2022 in Python by Nandini
• 5,480 points
573 views
0 votes
2 answers
+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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,449 views
0 votes
1 answer
+5 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,790 points
4,100 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,230 points
1,210 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 21, 2019 in Python by Mohammad
• 3,230 points
1,242 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP