All Algorithms implemented in Python
★ 225,984⑂ 51,271👁 5,932⑃ 13,095● 1,780▤ 0◈ 153
225,984
stars
+8
51,271
forks
5,932
watchers
13,095
prs
1,780
issues
0
releases
153
discussions
README
The Algorithms - Python
All algorithms implemented in Python - for education 📚
Implementations are for learning purposes only. They may be less efficient than the implementations in the Python standard library. Use them at your discretion.
🚀 Getting Started
📋 Read through our Contribution Guidelines before you contribute.
🌐 Community Channels
We are on Discord! Community channels are a great way for you to ask questions and get help. Please join us!
📜 List of Algorithms
See our directory for easier navigation and a better overview of the project.Top issues
#15187Tracking: complete the `ty` gradual-typing baseline (un-ignore rules; PEP 723 blocker astral-sh/ty#691)11 comments · 2026-09-04#15656binomial_distribution overflows at 171 trials even when the result is representable3 comments · 2026-10-28#15655continued_fraction uses float division, producing invalid terms for large integers and raising OverflowError2 comments · 2026-10-28#15696Optimize the linting's rules with RUff and Zizmor1 comments · 2026-11-07#15637ciphers/base58.py is a copy of base64_cipher.py — no Base58 implementation exists in the file1 comments · 2026-10-25#15636ciphers/base32.py and ciphers/base85.py encode Unicode code points instead of bytes: output diverges from the spec for non-ASCII, round-trips corrupt chars >= U+0400, arbitrary bytes crash1 comments · 2026-10-24#15633other/password.py: alternative_password_generator ignores the requested length when the required characters exceed it1 comments · 2026-10-24#15576Optimize Node.has_loop to use constant auxiliary space instead of O(N) space1 comments · 2026-10-14
Discussions
#15543What programming language do you like most?2 comments · 2026-10-09#15444How does `match` /` case` work in Python?2 comments · 2026-09-26#15163Standardizing Python's internal caching decorators or exploring a lightweight standard library alternative2 comments · 2026-09-02#15020python8 comments · 2026-08-12#14999How do Python decorators work internally?2 comments · 2026-08-04#14996Could someone explain how the Binary Search algorithm works with a simple Python example?2 comments · 2026-08-03#14994How to reverse a string in Python?4 comments · 2026-08-03#14966.0 comments · 2026-07-20
相关报道 (5)
News & coverage (18)
Hacker NewsAlgorithms Implemented in Python▲ 153 · 27 comments · 2018-09-22Hacker NewsAll Algorithms Implemented in Python▲ 5 · 0 comments · 2022-06-14Hacker NewsAll algorithms implemented in Python for education▲ 2 · 0 comments · 2018-09-12Hacker NewsAsk HN: Can anyone recommend a good implementation of algorithms?▲ 1 · 0 comments · 2020-11-24notePython for Manufacturing: Aggregate Inspection Data and Understand How Code Works2026-11-03i-programmer.infoImpact of AI on GitHub Revealed In Octoverse 20262026-11-03note[Python Implementation] Practical Automation Script for Online Execution on GitHub2026-10-27The Hacker NewsCritical Flaw in Python’s Popular Pillow Image Library Allows Code Execution via a Crafted Image2026-10-23The Hacker NewsLiteLLM Suspects GitHub Token Leak in AI Gateway Logs Behind Malicious Package Release2026-10-22VentureBeatGitHub confirms 3,800 internal repos stolen through poisoned VS Code extension as supply chain worm hits Microsoft’s Python SDK2026-05-20