Project Euler Problem #13 Python Solution (#935) · codemasta/Python@32d5c1a · GitHub
Skip to content

Commit 32d5c1a

Browse files
Blues1998poyea
authored andcommitted
Project Euler Problem TheAlgorithms#13 Python Solution (TheAlgorithms#935)
* Create text file for numbers * Create sol2.py * Pythonic version of Problem TheAlgorithms#16 solution * Update sol2.py * Valid Python code for Python version 2-3 * Update sol2.py
1 parent 78cd3df commit 32d5c1a

3 files changed

Lines changed: 111 additions & 0 deletions

File tree

project_euler/problem_13/num.txt

Lines changed: 100 additions & 0 deletions

project_euler/problem_13/sol2.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sum = 0
2+
with open("num.txt",'r') as f:
3+
for line in f:
4+
sum += int(line)
5+
print(str(sum)[:10])

project_euler/problem_16/sol2.py

Lines changed: 6 additions & 0 deletions

0 commit comments

Comments
 (0)