+ 1

Return meaning

Return meaning return(x+y)

7th Oct 2021, 3:10 AM
Bharathi R
Bharathi R - avatar
2 Réponses
+ 2
basically it assign the value of return statement to that function You can also make a variable of that like: return(x+y) You can store it in a variable: int result = name_of_funtion Now you can use this variable as other variables. The result variable contains value of x+y.
7th Oct 2021, 5:01 AM
Aryan Yadav
Aryan Yadav - avatar
+ 1
Return statement returns the value where we call to that function. Ex- def example(): return 'i am returning' print(example()) #output - i am returning If you don't specify the return statement then it won't print anything on the console.
7th Oct 2021, 3:32 AM
zexu knub
zexu knub - avatar