Skip to content

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

Merged
harshildarji merged 3 commits into
TheAlgorithms:masterfrom
rafagarciac:master
Oct 14, 2018
Merged

harshildarji merged 3 commits into
TheAlgorithms:masterfrom
rafagarciac:master

Conversation

@rafagarciac

Copy link
Copy Markdown
Member

Wrap in the main structure and other improvements

@rafagarciac

Copy link
Copy Markdown
Member Author

@purveshmakode24 Take a look! 😄

@harshildarji harshildarji left a comment •

Copy link
Copy Markdown
Member

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.

Comment thread Maths/fibonacciSeries.py Outdated
print(recur_fibo(i))
def main():
limit = int(input("How many terms to include in fibonacci series: "))
if isPositiveInteger:

Copy link
Copy Markdown
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