Skip to content

Instantly share code, notes, and snippets.

@brentxphillips
Created July 4, 2021 21:34
Show Gist options
  • Save brentxphillips/724021d34ee5cc17ba7b195269a7fee3 to your computer and use it in GitHub Desktop.
Save brentxphillips/724021d34ee5cc17ba7b195269a7fee3 to your computer and use it in GitHub Desktop.
Simple return value test, multiple booleans
# Simple value returning function, with nested conditional and boolean check/return
# return_test7.py
def pass_info(x, y):
add = x + y
# added a nested condition, checking if odd or even and assigning a boolean
if (add % 2 == 0):
boo = True
elif (add % 2 == 1):
boo = False
return boo
def main():
output = pass_info(7, 4)
print(output)
main()
# outputs true or false depending on inputs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment