Created
January 26, 2021 17:48
-
-
Save dmackinnon1/8a5b25bab7a7ce4a3800b757157243f1 to your computer and use it in GitHub Desktop.
a simple python example
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
# be nice with this simple example: | |
# only positive integers pls. | |
def fact(x): | |
if x == 1: | |
return x | |
else: | |
return x*fact(x-1) | |
a = 4 | |
print ("The factorial of " + str(a) | |
+ " is " + str(fact(4))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment