DEV Community

Durga Pokharel
Durga Pokharel

Posted on

1

Day 7 of 100DaysOfCode: Python Code to Find Fibonacci Numbers Up To Given Number

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)
Enter fullscreen mode Exit fullscreen mode

Day 7 of #100daysofcode and #Python
* 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 (@mathdurga) December 30, 2020

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (2)

Collapse
 
otumianempire profile image
Michael Otu

Every day I see you improve. And it is awesome.

Collapse
 
iamdurga profile image
Durga Pokharel

Thanks for your support 🙂

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay