From 7b624de8e3e3637a07364f992c1d7e4185e4a872 Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 11 Aug 2019 18:42:52 +0200 Subject: initial commit --- python/20-factorial_digit_sum.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 python/20-factorial_digit_sum.py (limited to 'python/20-factorial_digit_sum.py') diff --git a/python/20-factorial_digit_sum.py b/python/20-factorial_digit_sum.py new file mode 100644 index 0000000..a76b4ae --- /dev/null +++ b/python/20-factorial_digit_sum.py @@ -0,0 +1,9 @@ +import math + +one_hundred_factorial = math.factorial(100) + +to_list_of_int = [int(dgt) for dgt in list(str(one_hundred_factorial))] + +sum_of_all_digits = sum(to_list_of_int) + +print(sum_of_all_digits) -- cgit