Day 7 of 100DaysOfCode: Python Code to Find Fibonacci Numbers Up To Given Number
Durga Pokharel
Posted on December 30, 2020
This is my 7th day of 100daysofcoding. I continue to learn from Coursera Python Data Structure course and also did some program regarding to some mathematical problems. I tired to write code to find Fibonacci numbers up to given number. My code is right below.
def fibonacci_number(n):
a = 0
b = 1
fib = [a, b]
for i in range(n):
f = a + b
a = b
b = f
fib.append(f)
print(f"{fib}")
fibonacci_number(10)
Day 7 of #100daysofcode and #Python
— Durga Pokharel (@mathdurga) December 30, 2020
* More about HTML
* More about python program
* More about Python Data structure
* Python program to find the Fibonacci number from the given number pic.twitter.com/QrDuJsaQ1N
💖 💪 🙅 🚩
Durga Pokharel
Posted on December 30, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
100daysofcode Day 7 of 100DaysOfCode: Python Code to Find Fibonacci Numbers Up To Given Number
December 30, 2020