mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-24 05:21:09 +00:00
Adding Problem_08
This commit is contained in:
parent
1506ac9039
commit
744803ad64
15
Project Euler/Problem 08/sol1.py
Normal file
15
Project Euler/Problem 08/sol1.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
import sys
|
||||||
|
def main():
|
||||||
|
LargestProduct = -sys.maxsize-1
|
||||||
|
number=input().strip()
|
||||||
|
for i in range(len(number)-13):
|
||||||
|
product=1
|
||||||
|
for j in range(13):
|
||||||
|
product *= int(number[i+j])
|
||||||
|
if product > LargestProduct:
|
||||||
|
LargestProduct = product
|
||||||
|
print(LargestProduct)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
Loading…
Reference in New Issue
Block a user