Professional Documents
Culture Documents
Python
PSF
Docs
PyPI
Jobs
Community
Donate
Search This Site GO
Socialize
About
Downloads
Documentation
Community
Success Stories
News
Events
>_ Launch Interactive Shell
# Python 3: Fibonacci series up to n
>>> def fib(n):
>>> a, b = 0, 1
>>> while a < n:
>>> print(a, end=' ')
>>> a, b = b, a+b
>>> print()
>>> fib(1000)
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987
Functions Defined
The core of extensible programming is defining functions. Python allows mandatory and optional a
1. 1
2. 2
3. 3
4. 4
5. 5
Python is a programming language that lets you work
quicklyand integrate systems more effectively. Learn More
Get Started
Whether you're new to programming or an experienced developer, it's easy to learn and use
Python.
Latest: Python 3.9.6
Docs
Documentation for Python's standard library, along with tutorials and guides, are available online.
docs.python.org
Jobs
Looking for work or have a Python related position that you're trying to hire for?
Our relaunched community-run job board is the place to go.
jobs.python.org
Latest News
More
Success Stories
More
the PSF
About
o Applications
o Quotes
o Getting Started
o Help
o Python Brochure
Downloads
o All releases
o Source code
o Windows
o Mac OS X
o Other Platforms
o License
o Alternative Implementations
Documentation
o Docs
o Audio/Visual Talks
o Beginner's Guide
o Developer's Guide
o FAQ
o Non-English Docs
o PEP Index
o Python Books
o Python Essays
Community
o Community Survey
o Diversity
o Mailing Lists
o IRC
o Forums
o PSF Annual Impact Report
o Python Conferences
o Special Interest Groups
o Python Logo
o Python Wiki
o Merchandise
o Community Awards
o Code of Conduct
o Get Involved
o Shared Stories
Success Stories
o Arts
o Business
o Education
o Engineering
o Government
o Scientific
o Software Development
News
o Python News
o PSF Newsletter
o Community News
o PSF News
o PyCon News
Events
o Python Events
o User Group Events
o Python Events Archive
o User Group Events Archive
o Submit an Event
Contributing
o Developer's Guide
o Issue Tracker
o python-dev list
o Core Mentorship
o Report a Security Issue
Help & General Contact
Diversity Initiatives
Submit Website Bug
Status
Copyright ©2001-2021. Python Software Foundation Legal Statements Privacy Policy Powered by Heroku