From ccf076f9d209579b11802954135d6d8bdd947703 Mon Sep 17 00:00:00 2001 From: Shreya01-yadav <72158803+Shreya01-yadav@users.noreply.github.com> Date: Sat, 3 Oct 2020 22:46:57 +0530 Subject: [PATCH] Modified --- GoldbachConjecture.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/GoldbachConjecture.py b/GoldbachConjecture.py index 0c9c8fa..f52d3cf 100644 --- a/GoldbachConjecture.py +++ b/GoldbachConjecture.py @@ -26,9 +26,9 @@ def Goldbach(n): findPrimes(n) GoldbachNumbers[n] = [] for i in primes: - if i > n/2: - break - if n - i in primes: + if i > (n/2): + break + if (n - i) in primes: GoldbachNumbers[n].extend([i, n - i]) # Find the prime possibilities for all numbers up to N @@ -59,8 +59,7 @@ def findGoldbachs(n): # I/O loop x = 2 while x > 0: - x = int(input('Enter an even number: ')) - # x = 10000 + x = int(input('Enter an even number: ') findGoldbachs(x) print(GoldbachNumbers[x])