How do we return a value from a function i.e from a subfunction to a main function?
return values from a function
Collapse
X
-
There are plenty of considerations that would make this a bad example but the simple answer is just use "return"
Code:>>> def return_value(number): ... return number*2 ... >>> return_value(5) 10
Originally posted by techyvibeHow do we return a value from a function i.e from a subfunction to a main function?
Comment