-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
base: master
Are you sure you want to change the base?
Conversation
b=c | ||
print(c) | ||
|
||
print(fb(n)) #enter the value of n in postive integer by which u want to calculate fabonacci series. |
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.
Add a empty line at the end of each file. :)
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. |
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.
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. |
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.
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 |
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.
Using iteration & switch values are nice idea for printing out fabonacci series. 👍
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.
very veryy thankk u sir
@@ -0,0 +1,16 @@ | |||
def fb(n): |
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.
Also fb
is not a good function name, fabonacci
maybe better
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 |
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