Skip to content

Improve and Refactor the fibonnaciSeries.py (Recursion) #447

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

Merged
merged 3 commits into from
Oct 14, 2018
Merged

Improve and Refactor the fibonnaciSeries.py (Recursion) #447

merged 3 commits into from
Oct 14, 2018

Conversation

rafagarciac
Copy link
Member

Wrap in the main structure and other improvements

@rafagarciac
Copy link
Member Author

@purveshmakode24 Take a look! 😄

Copy link
Member

@harshildarji harshildarji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafagarciac Please review your code again.

print(recur_fibo(i))
def main():
limit = int(input("How many terms to include in fibonacci series: "))
if isPositiveInteger:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should write:

if isPositiveInteger(limit):

Otherwise, It will not show the error message when provided a negative number.
Following is the output of your current script when you provide a negative number:

How many terms to include in fibonacci series:  -7
The first -7 terms of the fibonacci series are as follows:
[]

Instead it should display something like:

How many terms to include in fibonacci series:  -7
Please enter a positive integer.

@harshildarji harshildarji merged commit 7418ee7 into TheAlgorithms:master Oct 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants