From 1568432e82cfc69c7c02b334e0bcc89542d79881 Mon Sep 17 00:00:00 2001 From: Ben <34241521+arcsinecosine@users.noreply.github.com> Date: Sun, 21 Jan 2018 03:27:19 -0500 Subject: [PATCH 1/2] Add files via upload --- Project Euler/Problem 01/sol4.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Project Euler/Problem 01/sol4.py diff --git a/Project Euler/Problem 01/sol4.py b/Project Euler/Problem 01/sol4.py new file mode 100644 index 000000000..0f5dc370b --- /dev/null +++ b/Project Euler/Problem 01/sol4.py @@ -0,0 +1,32 @@ +def mulitples(limit): + xmulti = [] + zmulti = [] + z = 3 + x = 5 + temp = 1 + while True: + result = z * temp + if (result < limit): + zmulti.append(result) + temp += 1 + continue + else: + temp = 1 + break + while True: + result = x * temp + if (result < limit): + xmulti.append(result) + temp += 1 + continue + else: + temp = 1 + break + return (sum(zmulti) + sum(xmulti)) + + + + + + +print (mulitples(100)) From 92e0aa29b9c0db1590b0ec032177dd8dced750ff Mon Sep 17 00:00:00 2001 From: Ben <34241521+arcsinecosine@users.noreply.github.com> Date: Sun, 21 Jan 2018 03:34:09 -0500 Subject: [PATCH 2/2] Add files via upload --- Project Euler/Problem 02/sol2.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Project Euler/Problem 02/sol2.py diff --git a/Project Euler/Problem 02/sol2.py b/Project Euler/Problem 02/sol2.py new file mode 100644 index 000000000..f0502a389 --- /dev/null +++ b/Project Euler/Problem 02/sol2.py @@ -0,0 +1,13 @@ +def fib(n): + ls = [] + a,b = 0,1 + n += 1 + for i in range(n): + if (b % 2 == 0): + ls.append(b) + else: + pass + a,b = b, a+b + print (sum(ls)) + return None +fib(10)