From 10b0a40b2eae2e986cffd6d4760ada01a6ee99b1 Mon Sep 17 00:00:00 2001 From: Christian Bender Date: Sun, 15 Apr 2018 23:52:45 +0200 Subject: [PATCH] fixed solution 4 of problem 1 --- Project Euler/Problem 01/sol4.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Project Euler/Problem 01/sol4.py b/Project Euler/Problem 01/sol4.py index 0f5dc370b..7941f5fcd 100644 --- a/Project Euler/Problem 01/sol4.py +++ b/Project Euler/Problem 01/sol4.py @@ -9,7 +9,6 @@ def mulitples(limit): if (result < limit): zmulti.append(result) temp += 1 - continue else: temp = 1 break @@ -18,15 +17,14 @@ def mulitples(limit): if (result < limit): xmulti.append(result) temp += 1 - continue else: - temp = 1 break - return (sum(zmulti) + sum(xmulti)) + collection = list(set(xmulti+zmulti)) + return (sum(collection)) -print (mulitples(100)) +print (mulitples(1000))