aboutsummaryrefslogtreecommitdiffstats
path: root/16-Power-Digit-Sum/sumexp.py
diff options
context:
space:
mode:
Diffstat (limited to '16-Power-Digit-Sum/sumexp.py')
-rw-r--r--16-Power-Digit-Sum/sumexp.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/16-Power-Digit-Sum/sumexp.py b/16-Power-Digit-Sum/sumexp.py
new file mode 100644
index 0000000..a4d8eaf
--- /dev/null
+++ b/16-Power-Digit-Sum/sumexp.py
@@ -0,0 +1,9 @@
+# Problem 16 Power digit sum
+n = 2**1000
+strn = str(n)
+s = 0
+
+for i in strn:
+ s += int(i)
+
+print(s)