From 744803ad648d6984f00a23fd9abc3547bae6c32e Mon Sep 17 00:00:00 2001 From: shivg7706 Date: Tue, 27 Feb 2018 19:19:53 +0530 Subject: [PATCH] Adding Problem_08 --- Project Euler/Problem 08/sol1.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Project Euler/Problem 08/sol1.py diff --git a/Project Euler/Problem 08/sol1.py b/Project Euler/Problem 08/sol1.py new file mode 100644 index 000000000..fb5ed25bf --- /dev/null +++ b/Project Euler/Problem 08/sol1.py @@ -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()