-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
Rewrote fibonacci.py (#5665) #5677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dynamic_programming/fibonacci.py
Outdated
for _ in range(index): | ||
self.sequence.append(self.sequence[-1] + self.sequence[-2]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put inside get
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes makes sense
Thanks for the rewrite, @citharus! Make sure to link this PR to the original issue so GitHub knows to close the issue automatically when this PR gets merged (just |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your pull request!🤩
Describe your change:
I rewrote
fibonacci.py
as it was requested in #5665. The changes I made include:Separated the logic to calculate Fibonacci numbers into the
get
method.Removed
Out of Bound
, by calculating the missing numbers with the stored sequence.Created
main
function with new prompt.Changed
get
method documentation.Fix a bug or typo in an existing algorithm?
Documentation change?
Checklist:
Fixes: #{$ISSUE_NO}
.Fixes: #5665