From 4c1a99bd58a878b37ce10f3d1f53cf4a4056af9e Mon Sep 17 00:00:00 2001 From: SreejaVeerappan <144646423+SreejaVeerappan@users.noreply.github.com> Date: Sat, 19 Oct 2024 05:09:26 +0530 Subject: [PATCH] Update NewmanConwaySequence.py --- NewmanConwaySequence.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/NewmanConwaySequence.py b/NewmanConwaySequence.py index 9b7931f80..acf64c7b0 100644 --- a/NewmanConwaySequence.py +++ b/NewmanConwaySequence.py @@ -1,7 +1,7 @@ def newmanConwaySequence(n): - if n==1 or n==2: + if n == 1 or n == 2: return 1 - return newmanConwaySequence(newmanConwaySequence(n-1))+newmanConwaySequence(n-newmanConwaySequence(n-1)) + return newmanConwaySequence(newmanConwaySequence(n-1)) + newmanConwaySequence(n-newmanConwaySequence(n-1)) -n=int(input("Enter a number")) -print(newmanConwaySequence(n)) \ No newline at end of file +n = int(input("Enter a number: ")) +print(newmanConwaySequence(n))