mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-19 19:03:02 +08:00
* Create text file for numbers * Create sol2.py * Pythonic version of Problem #16 solution * Update sol2.py * Valid Python code for Python version 2-3 * Update sol2.py
This commit is contained in:
6
project_euler/problem_16/sol2.py
Normal file
6
project_euler/problem_16/sol2.py
Normal file
@ -0,0 +1,6 @@
|
||||
from __future__ import print_function
|
||||
n = 2**1000
|
||||
r = 0
|
||||
while n:
|
||||
r, n = r + n % 10, n // 10
|
||||
print(r)
|
Reference in New Issue
Block a user