Skip to content

Repository files navigation

Python Exercices

300+ Python exercises with solutions, organized by topic — written while learning Python, from the basics to more advanced data structures and algorithms.

Each folder contains exercises and their corrected solutions (corrigés), so you can attempt a problem first and then check your approach against a working answer.

🐍 Learning Python or brushing up before an interview? You're in the right place — browse a topic below, and if this saves you time, a ⭐ on this repo helps others find it too.


Why this repo might be useful to you

  • Learning Python on your own — practice topic by topic, with a solution to check yourself against instead of guessing if your code is "right."
  • Preparing for technical interviews — folders like recursion, sort_search, linkedList, and heap_q cover classic interview topics.
  • Teaching or tutoring — a ready-made bank of exercises you can reuse or adapt for a class, workshop, or coding club.
  • Quick reference — need a concrete example on JSON parsing, re (regex), or file_input_output? Find a working snippet instead of searching from scratch.

Topics covered

Folder Topic
python_basic_I Python fundamentals
conditional_statements_loops If/else statements, for/while loops
functions Function definitions, arguments, return values
lambda Lambda (anonymous) functions
arrays Arrays / lists basics
exos_list List exercises
exos_dictionnary Dictionary exercises
Sets Set operations
Tuple Tuple exercises
Collections The collections module (Counter, defaultdict, etc.)
strings String manipulation
class Object-Oriented Programming (classes, objects)
Enum Enumerations
recursion Recursive algorithms
sort_search Sorting and searching algorithms
linkedList Linked list implementations
heap_q Heaps / priority queues (heapq)
Bisect Binary search with the bisect module
map The map() function and functional-style operations
math The math module
re Regular expressions
JSON Reading/writing JSON data
file_input_output File reading and writing
Modules Working with Python modules
python_programming General programming exercises

How to use this repo

  1. Pick a folder matching what you want to practice.
  2. Try to solve the exercise yourself first.
  3. Compare your solution with the corrected version (corrigé) in the same folder.
  4. Move to the next topic once you're comfortable.

Tech stack

  • Python

If this repo helped you learn or review something, consider leaving a ⭐ — it's a small click that goes a long way for an open-source project.


Dona 😎

About

300+ Python exercises with solutions, covering everything from basics to data structures, OOP, recursion, and algorithms — great for anyone learning Python.

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages