aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBraxton Hall2022-12-19 14:15:09 +0000
committerGitHub2022-12-19 14:15:09 +0000
commit777b3fba70f2253fa2f8f0bd4c9b207b8ce0a11f (patch)
treefe52f7a18fef3c6b1f21e2681e815bf62dfe535c
parent77e827e1ad5e4598811335e7f0c9bfeb20a425c4 (diff)
parentebd167d36dd376e7ce83cb6858c6fd396f0b3ecd (diff)
Merge pull request #96 from jjhickmon/main
Javon contributor PR
-rw-r--r--entries/jjhickmon/fibonacci.py14
-rw-r--r--people.json11
2 files changed, 25 insertions, 0 deletions
diff --git a/entries/jjhickmon/fibonacci.py b/entries/jjhickmon/fibonacci.py
new file mode 100644
index 0000000..7e9f5f6
--- /dev/null
+++ b/entries/jjhickmon/fibonacci.py
@@ -0,0 +1,14 @@
+def fib(index):
+ if (index < 0):
+ raise IndexError("Error: index must be >= 0")
+
+ prev = 1
+ curr = 1
+ for _ in range(index - 1):
+ temp = curr
+ curr += prev
+ prev = temp
+ return curr
+
+if __name__ == "__main__":
+ print(fib(5))
diff --git a/people.json b/people.json
index 67424df..ea6f724 100644
--- a/people.json
+++ b/people.json
@@ -743,5 +743,16 @@
"link": "./entries/williamvietnguyen/fibberoni.c"
}
]
+ },
+ {
+ "github": "jjhickmon",
+ "name": "Javon Hickmon",
+ "title": "Undergraduate CS Student, UW",
+ "entries": [
+ {
+ "name": "fibonacci",
+ "link": "./entries/jjhickmon/fibonacci.py"
+ }
+ ]
}
]