How to use of “return” keyword in a function


Tue Mar 31 2020 05:43:21 GMT+0000 (Coordinated Universal Time)

Saved by @EnjoyByte #python #function #returnfunction

#define a function 
 1.Def cube(num)
      #write the formula of cube
      2.return num*num*num
     #give the number to calculate the cube 
   # print the cube of that number simply by using print command
     5.“return” keyword means that function have to return value         

return is the keyword that this program has to return value. A return statement ends the execution of a function call and "returns" the result the value of the expression following the return keyword, to the caller. If the return statement is without an expression, the special value None is returned.