+ 4

What does the return statement in python do?

5th Jul 2018, 7:18 AM
Abimanyu
Abimanyu - avatar
4 Answers
+ 1
def sumwithreturn(x,y): return (x+y) def sumwithoutreturn(x,y): print(x+y) print(sumwithreturn(5,10)) print(sumwithoutreturn(5,10)) run this you will get to know
5th Jul 2018, 7:28 AM
Pulkit Kamboj
Pulkit Kamboj - avatar
+ 3
ok thanks 😉
5th Jul 2018, 7:32 AM
Abimanyu
Abimanyu - avatar
+ 3
it basically do two thing when include in function.... 1.Store output to function. 2 Terminate other code after return.
8th Feb 2019, 11:03 AM
Sarvesh Yadav
Sarvesh Yadav - avatar
+ 2
Thq
8th Feb 2019, 12:49 PM
Abimanyu
Abimanyu - avatar