Created
July 4, 2021 20:23
-
-
Save brentxphillips/82bc9c6b778e8d8a545b0c54cbb2eee7 to your computer and use it in GitHub Desktop.
Simple value returning function, two returned values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple value returning function, two retunred values | |
# return_test3.py | |
def pass_info(x, y): | |
add = x + y | |
sub = x - y | |
# note, if one return variable is removed then the main function will only output remaining value | |
return add, sub | |
def main(): | |
output = pass_info(5, 4) | |
print(output) | |
main() | |
# outputs: (9, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment