Skip to content
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

a new code for fabonacci series for beginner to understand #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

a new code for fabonacci series for beginner to understand #36

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 10, 2020

as i am new to git hub and this is my first contribution so if any mistake i did then plss forgive me ..Sir i made new file name fabonacci.py . ur code was amazing and outstanding level .. but they all were very high level of code i see all of them and only in this i am able to make chnages as for beginner .. so plss promote it
THANK U

b=c
print(c)

print(fb(n)) #enter the value of n in postive integer by which u want to calculate fabonacci series.
Copy link
Owner

Choose a reason for hiding this comment

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

Add a empty line at the end of each file. :)

@qiyuangong
Copy link
Owner

qiyuangong commented Nov 11, 2020

Hi @Vikashyadav-8090. Thank you for your contribution!

You code is very concise! I added a few comments to your code. Hope that can help you. :)

But, I'm not sure if your code is related to leetcode problems. If it is, pls rename your file according to current source code file names. If it's not, pls close this PR. This repo is only for leetcode solution & code.

@@ -0,0 +1,16 @@
def fb(n):

a=0 # a is the first number in fabonacci series.
Copy link
Owner

Choose a reason for hiding this comment

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

a,b,c is not good variable names.

@@ -0,0 +1,16 @@
def fb(n):

a=0 # a is the first number in fabonacci series.
Copy link
Owner

Choose a reason for hiding this comment

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

Pay attention to code styles, you can refer to PEP8 for Python code.

"""
by printing the above condition the fabonacci series is : 0 1 1 and so till n
"""
for i in range(2,n+1): # by using for it will iterate till n
Copy link
Owner

Choose a reason for hiding this comment

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

Using iteration & switch values are nice idea for printing out fabonacci series. 👍

Copy link
Author

Choose a reason for hiding this comment

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

very veryy thankk u sir

@@ -0,0 +1,16 @@
def fb(n):
Copy link
Owner

Choose a reason for hiding this comment

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

Also fb is not a good function name, fabonacci maybe better

@ghost
Copy link
Author

ghost commented Nov 11, 2020

Thank u so much sir for ur good advice for me as it is very informative and i surely improve my skill keeping ur lines in mind . Thank 4 ur compliment sir

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