From 87fefdbab5a01d1ce5ebc99af1adaeb51af318cb Mon Sep 17 00:00:00 2001 From: noh_taewon Date: Fri, 24 Nov 2023 17:01:14 +0900 Subject: [PATCH 1/3] Fix Failing FibonacciTestCases --- fib.py | 9 +++++++++ fib.py.txt | 9 +++++++++ github-assignment-python | 1 + hw2repo | 1 + 4 files changed, 20 insertions(+) create mode 100644 fib.py create mode 100644 fib.py.txt create mode 160000 github-assignment-python create mode 160000 hw2repo diff --git a/fib.py b/fib.py new file mode 100644 index 0000000..74746a3 --- /dev/null +++ b/fib.py @@ -0,0 +1,9 @@ +def fibonacci(position): + if position < 0: + return None + elif position == 0: + return 0 + elif position == 1: + return 1 + else: + return fibonacci(position - 1) + fibonacci(position - 2) \ No newline at end of file diff --git a/fib.py.txt b/fib.py.txt new file mode 100644 index 0000000..74746a3 --- /dev/null +++ b/fib.py.txt @@ -0,0 +1,9 @@ +def fibonacci(position): + if position < 0: + return None + elif position == 0: + return 0 + elif position == 1: + return 1 + else: + return fibonacci(position - 1) + fibonacci(position - 2) \ No newline at end of file diff --git a/github-assignment-python b/github-assignment-python new file mode 160000 index 0000000..5edddab --- /dev/null +++ b/github-assignment-python @@ -0,0 +1 @@ +Subproject commit 5edddab4a2c1df062ae1e50efb3411d6bc105efb diff --git a/hw2repo b/hw2repo new file mode 160000 index 0000000..a9a8041 --- /dev/null +++ b/hw2repo @@ -0,0 +1 @@ +Subproject commit a9a80417d485367af5b8bf9b923f7c07ee3562c8 From 0fb60d96017c13738969e5b6f84c0e349067e8cb Mon Sep 17 00:00:00 2001 From: noh_taewon Date: Sat, 25 Nov 2023 19:32:07 +0900 Subject: [PATCH 2/3] Remove fib.py.txt --- fib.py | 10 +--------- fib.py.txt | 9 --------- 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 fib.py.txt diff --git a/fib.py b/fib.py index 6dc1622..cd2c2d8 100644 --- a/fib.py +++ b/fib.py @@ -6,12 +6,4 @@ def fibonacci(position): elif position == 1: return 1 else: - return fibonacci(position - 1) + fibonacci(position - 2) - - -""" -Fibonacci number generator -When given a position, the function returns the fibonacci at that position in the sequence. -The zeroth number in the fibonacci sequence is 0. The first number is 1 -Negative numbers should return None -""" + return fibonacci(position - 1) + fibonacci(position - 2) \ No newline at end of file diff --git a/fib.py.txt b/fib.py.txt deleted file mode 100644 index 74746a3..0000000 --- a/fib.py.txt +++ /dev/null @@ -1,9 +0,0 @@ -def fibonacci(position): - if position < 0: - return None - elif position == 0: - return 0 - elif position == 1: - return 1 - else: - return fibonacci(position - 1) + fibonacci(position - 2) \ No newline at end of file From 5d4ceb4216b3a5fd64f4f3702f2128b6bd9efa6e Mon Sep 17 00:00:00 2001 From: noh_taewon Date: Sun, 26 Nov 2023 02:06:36 +0900 Subject: [PATCH 3/3] fix fib.py.txt --- fib.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fib.py b/fib.py index cd2c2d8..ca108ca 100644 --- a/fib.py +++ b/fib.py @@ -1,9 +1,9 @@ def fibonacci(position): - if position < 0: - return None - elif position == 0: - return 0 - elif position == 1: - return 1 - else: - return fibonacci(position - 1) + fibonacci(position - 2) \ No newline at end of file + if position < 0: + return None + elif position == 0: + return 0 + elif position == 1: + return 1 + else: + return fibonacci(position - 1) + fibonacci(position - 2) \ No newline at end of file