Skip to content

Instantly share code, notes, and snippets.

@brentxphillips
Created July 4, 2021 20:23
Show Gist options
  • Save brentxphillips/82bc9c6b778e8d8a545b0c54cbb2eee7 to your computer and use it in GitHub Desktop.
Save brentxphillips/82bc9c6b778e8d8a545b0c54cbb2eee7 to your computer and use it in GitHub Desktop.
Simple value returning function, two returned values
# 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