From 1161f9a034de06a63538e3a9a0b7717098c744d9 Mon Sep 17 00:00:00 2001 From: Joshua Drake Date: Fri, 7 Apr 2023 08:13:49 -0500 Subject: Initial Commit --- Problem20.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Problem20.py (limited to 'Problem20.py') diff --git a/Problem20.py b/Problem20.py new file mode 100644 index 0000000..6b64cd6 --- /dev/null +++ b/Problem20.py @@ -0,0 +1,10 @@ +def factorial(n): + if n > 1: + return n*factorial(n-1) + else: + return 1 +factorialString = str(factorial(100)) +count = 0 +for x in range(0,len(factorialString)): + count += int(factorialString[x]) +print(count) \ No newline at end of file -- cgit v1.2.3