Last active
September 28, 2022 23:49
-
-
Save benjaminEwhite/65249517494c65de2c1a to your computer and use it in GitHub Desktop.
demonstration of python functions
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
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