/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/usr/bin/python # Project Euler - Problem 20 import math print "\nProject Euler - Problem 20" print " What is the sum of the digits of 100!?\n" num = math.factorial(100) sum = 0 str = str(num) for x in str: sum += int(x) print sum