Skip to content

Instantly share code, notes, and snippets.

@benjaminEwhite
Last active September 28, 2022 23:49
Show Gist options
  • Save benjaminEwhite/65249517494c65de2c1a to your computer and use it in GitHub Desktop.
Save benjaminEwhite/65249517494c65de2c1a to your computer and use it in GitHub Desktop.
demonstration of python functions
def subtractor(a, b):
"""I subtract b from a and return the result"""
print("I'm a function. My name is {}".format(subtractor.__name__))
print("I'm about to subtract {} and {}\n\n".format(a,b))
return a - b # i output a value by using the return statement
if __name__ == '__main__':
subtractor(3, 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment