- 4

Addtion of two numbers using function.in python

8th Sep 2020, 8:49 AM
Iragani Vamsi sai
Iragani Vamsi sai - avatar
6 Answers
+ 8
It is strongly recommended NOT to use function names of build-in functions <e.g. sum()> as names for user defined functions. This can lead to an unexpected behavior. Use sum_() instead.
8th Sep 2020, 9:24 AM
Lothar
Lothar - avatar
+ 2
#Anonymous or inline function: print((lambda x,y: x+y)(2,3)) #Output: 5 #function: def add(x,y): return x+y print(add(2,3)) #Output: 5 https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2437/?ref=app
8th Sep 2020, 8:59 AM
Jenson Y
+ 1
print(sum([2,3]))
8th Sep 2020, 9:51 AM
Shadoff
Shadoff - avatar
0
int.__add__(9, 2) ---> 11 sum(7, 3) ---> 10
8th Sep 2020, 9:00 AM
Seb TheS
Seb TheS - avatar
0
def sum(x,y): return x+y print(sum(x,y))
8th Sep 2020, 9:01 AM
Roy
Roy - avatar
21st Apr 2022, 11:55 AM
AARAV PANDEY
AARAV PANDEY - avatar