|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#!/usr/bin/python
import sys;
def factorial(num):
result = 1
for i in range(1,num+1):
result *= i
return result
def sumDigits(num):
sum = 0;
for i in range (0,len(num)):
sum += int(num[i]);
return sum;
print "Result is: " + str(sumDigits(str(factorial(int(sys.argv[1])))))
|