Compare commits

...

2 Commits

Author SHA1 Message Date
  depp 6d6792d3f9 Added factorial.py 3 years ago
  depp c73dcf9ccc Added gitignore 3 years ago
2 changed files with 15 additions and 0 deletions
Split View
  1. +1
    -0
      .gitignore
  2. +14
    -0
      factorial.py

+ 1
- 0
.gitignore View File

@@ -0,0 +1 @@
*.class

+ 14
- 0
factorial.py View File

@@ -0,0 +1,14 @@
import sys

def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n-1)

def main():
n = int(sys.argv[1])
print(factorial(n))

if __name__ == '__main__':
main()

Loading…
Cancel
Save