Aller au contenu

Tutoriel Python

Learn Python from your first print() to classes, files and async code. Real Python running in your browser, quizzes and projects. No installation needed.

Getting Started

  1. 1 Premiers pas avec Python Meet Python, one of the most popular programming languages. Print your first messages, store values in variables, read input and do quick calculations, all in your browser.
  2. 2 Exécuter du code Python Learn the ways to run Python - the interactive REPL, script files, editors and IDEs - how to install it, and what the in-browser runner on this site can do.
  3. 3 Syntaxe et indentation Learn how Python reads your code - statements, indentation blocks, long lines, case sensitivity and comments - and how to fix IndentationError and SyntaxError.
  4. 4 Variables et noms Learn how Python variables work - assignment, naming rules and conventions, multiple assignment, swapping values and dynamic typing - with examples to run.
  5. 5 Entrée et sortie Control Python output with print() options like sep and end, read user input with input(), convert it to numbers safely, and format results neatly.

Data Types

  1. 6 Types de données Tour Python's built-in data types - numbers, strings, lists, tuples, dicts, sets and None - check them with type() and isinstance(), and learn about mutability.
  2. 7 Nombres Work with Python numbers - int, float and complex, arithmetic, rounding rules, why 0.1 + 0.2 isn't 0.3, and exact math with the decimal and fractions modules.
  3. 8 Chaînes de caractères Learn Python strings - single, double and triple quotes, escape sequences, raw strings, indexing characters, immutability, and joining and repeating text.
  4. 9 Méthodes de chaînes Master Python's most useful string methods - changing case, strip, split and join, find and replace, startswith, count and the is-checks - with live examples.
  5. 10 Mise en forme des chaînes Format text with Python f-strings - expressions, the = specifier, alignment, padding, decimals, thousands separators, percentages, dates and str.format().
  6. 11 Booléens et valeur de vérité Learn how Python's bool type works, which values count as truthy or falsy, how bool() converts values, and why True behaves like the number 1.
  7. 12 None Learn what None means in Python, why you check it with "is None", where it appears as a default return value, and how to use it safely for optional values.
  8. 13 Conversion de types Convert between Python types with int(), float(), str() and bool(). Learn implicit vs explicit conversion, rounding traps, and how to handle ValueError safely.
  9. 14 bytes et bytearray Learn Python's binary types. Encode and decode text, slice and search bytes, change data with bytearray, read hex and use struct to pack numbers.
  10. 15 Copies superficielles et profondes Understand aliasing in Python. Learn why assignment does not copy, how shallow copies share nested data, and when to use copy.deepcopy.

Operators

  1. 16 Opérateurs arithmétiques Master Python's arithmetic operators: + - * / // % and **. Learn floor division with negatives, modulo tricks, divmod(), and the operator precedence rules.
  2. 17 Opérateurs de comparaison et logiques Compare values with ==, !=, < and >, chain comparisons like 0 < x < 10, and combine conditions with and, or and not, including short-circuit evaluation.
  3. 18 Opérateurs d'affectation et morse Update variables with Python's augmented assignment operators like += and *=, see how they behave with lists and strings, and learn when the walrus operator := helps.
  4. 19 Opérateurs d'appartenance et d'identité Use in and not in to search strings, lists, sets and dicts, and is and is not to check object identity. Learn the real difference between == and is in Python.
  5. 20 Opérateurs bit à bit et priorité Learn Python's bitwise operators &, |, ^, ~, << and >> with binary examples, flags and bitmasks, plus the full operator precedence table and its common traps.

Control Flow

  1. 21 if, elif et else Make decisions in Python with if, elif and else. Learn how conditions and indentation work, how to avoid deep nesting, and when to use a conditional expression.
  2. 22 Filtrage par motifs avec match Learn Python's match statement with literal, capture, wildcard, sequence, mapping and class patterns, plus guards, OR patterns and when to choose if/elif.
  3. 23 Boucles for Learn Python for loops step by step. Iterate over strings, lists and dictionaries, number items with enumerate(), pair them with zip() and nest loops safely.
  4. 24 Boucles while Learn how Python while loops repeat code while a condition is true. Validate input, use sentinel values, write while True loops and avoid accidental infinite loops.
  5. 25 break, continue et else de boucle Control Python loops precisely. Exit early with break, skip iterations with continue, use the for/while else clause for searches, and fill empty blocks with pass.
  6. 26 range() Master Python's range(). Count with start, stop and step, loop backward, understand why the stop value is excluded, and see why range objects use almost no memory.

Data Structures

  1. 27 Listes Learn Python lists from scratch. Create lists, read items with positive and negative indexes, change them in place, understand shared references and work with nested lists.
  2. 28 Méthodes des listes A practical tour of Python list methods. Add items with append, extend and insert, remove them with remove, pop and clear, then sort, reverse, search, count and copy.
  3. 29 Tranches (slicing) Learn Python slicing with start:stop:step. Take parts of lists and strings, use negative indexes and steps, reverse with [::-1] and replace sections with slice assignment.
  4. 30 Compréhensions de listes Write Python list comprehensions with confidence. Transform and filter data in one line, use if/else inside them, flatten nested lists and know when a plain loop reads better.
  5. 31 Les tuples Learn Python tuples, the fixed-size sequences you can't change. Create them, index them, pack and unpack values, and meet named tuples for readable records.
  6. 32 Les ensembles Learn Python sets for storing unique values. Remove duplicates, test membership fast, and combine collections with union, intersection, difference and frozenset.
  7. 33 Les dictionnaires Learn Python dictionaries, the key-value store behind most Python code. Create them, read and change values, delete keys, loop over items and rely on their order.
  8. 34 Méthodes des dictionnaires Master Python dictionary methods. Use get and setdefault for missing keys, update and the | operator to merge, pop and popitem to remove, and views to inspect data.
  9. 35 Compréhensions de dictionnaires et d'ensembles Build dictionaries and sets in one readable line with Python comprehensions, filter and transform data, and save memory with lazy generator expressions.
  10. 36 Dépaquetage et expressions étoilées Learn Python unpacking. Split sequences into variables, grab the rest with a star, ignore values with _, and spread lists and dicts with * and ** in calls and literals.
  11. 37 Tableaux avec le module array Learn when Python's array module beats lists. Store typed numbers compactly with array.array, and use bytes, bytearray and memoryview.

Functions

  1. 38 Les fonctions Learn to write your own Python functions with def. Pass in parameters, return results, document them with docstrings, and organize programs into small reusable pieces.
  2. 39 Arguments : valeurs par défaut, *args et **kwargs Master Python function arguments. Use positional and keyword arguments, default values, *args and **kwargs, keyword-only and positional-only parameters safely.
  3. 40 Valeurs de retour Learn how Python functions send results back with return, how to return several values as a tuple, why early returns simplify code, and when you get None.
  4. 41 Portée : locale, globale et nonlocal Understand where Python looks up names with the LEGB rule, how local and global variables differ, when to use global and nonlocal, and how closures work.
  5. 42 Fonctions lambda Write small anonymous functions with Python's lambda, use them as sort keys and callbacks, learn their limits, and know when a regular def is the better choice.
  6. 43 La récursivité Learn recursion in Python step by step - base cases, recursive cases, the call stack, RecursionError, and speeding up recursive functions with functools.cache.
  7. 44 Fonctions d'ordre supérieur Treat functions as values in Python - pass them as arguments, return them from other functions, and use map, filter, sorted, min, max and reduce effectively.
  8. 45 Les décorateurs Learn how Python decorators wrap functions to add timing, logging, caching or validation, why functools.wraps matters, and how to write decorators that take arguments.
  9. 46 Générateurs Write Python generator functions with yield, build lazy and infinite sequences, use generator expressions to save memory, chain pipelines and delegate with yield from.
  10. 47 Itérateurs et protocole d'itération See how Python for loops really work - iterables vs iterators, iter() and next(), writing classes with __iter__ and __next__, and a first look at itertools.

Modules and the Standard Library

  1. 48 Modules et imports Learn how Python modules work. Use import, from ... import and aliases, write your own module, and understand the if __name__ == "__main__" idiom.
  2. 49 Paquets et pip Learn how Python packages group modules into folders, how relative imports work, and how to install third-party code from PyPI with pip and requirements files.
  3. 50 math et random Use Python's math module for roots, rounding, logs and trigonometry, generate random numbers and choices with random, and summarize data with statistics.
  4. 51 uuid, identifiants aléatoires et clés uniques Generate unique identifiers in Python with uuid1, uuid4, uuid5 and uuid7, create secure tokens with secrets, and learn when collisions matter and which ID to use.
  5. 52 Dates et heures Work with dates and times in Python using datetime, date and timedelta. Do date math, format and parse strings with strftime and strptime, and handle time zones.
  6. 53 collections Learn Python's collections module. Count things with Counter, group with defaultdict, build fast queues with deque, and use namedtuple and ChainMap well.
  7. 54 itertools et functools Master Python's itertools and functools. Chain, group, slice and combine iterables lazily, then use partial, reduce and cache to build smarter functions.
  8. 55 Travailler avec JSON Learn to read and write JSON in Python. Convert data with json.dumps and json.loads, save JSON files, pretty-print, handle errors and encode dates and classes.
  9. 56 Enregistrer des objets avec pickle et shelve Save almost any Python object to bytes or a file with pickle, store objects by key with shelve, avoid the security trap, and copy with deepcopy.
  10. 57 XML avec ElementTree Read and write XML in Python with ElementTree. Parse documents, find elements with XPath, handle namespaces, build and save XML, and use defusedxml.
  11. 58 Expressions régulières Learn regular expressions in Python with the re module. Write patterns, match and search text, capture groups, find all matches, replace text and compile patterns.
  12. 59 Chemins avec pathlib Handle files and folders the modern way with pathlib. Build paths with /, inspect names and suffixes, read and write files, create folders and find files with glob.
  13. 60 Fichiers et dossiers avec os et shutil Work with folders in Python. List and walk directories with os, read environment variables, copy, move and delete trees with shutil, use tempfile.
  14. 61 decimal et fractions Avoid floating-point surprises in Python. Use Decimal for money, control precision and rounding with contexts, and Fraction for exact rational numbers.
  15. 62 Le module statistics Summarize small data sets with Python's statistics module. Compute mean, median, mode, standard deviation, quantiles, correlation and linear regression.

Files and Errors

  1. 63 Lire et écrire des fichiers Learn to read and write text files in Python with open() and the with statement. Covers file modes, reading line by line, appending, and encodings.
  2. 64 Fichiers CSV Read and write CSV files in Python with csv.reader, csv.writer, DictReader and DictWriter. Learn about quoting, delimiters, headers and number conversion.
  3. 65 Fichiers Excel avec openpyxl Read and write Excel .xlsx files with openpyxl. Create workbooks, fill cells, add formulas, style headers, set number formats, add charts and use pandas.
  4. 66 Exceptions et try/except Learn how Python exceptions work and how to handle them with try, except, else and finally. Catch specific errors, inspect them, and avoid common mistakes.
  5. 67 Fichiers PDF avec pypdf Work with PDF files in Python using pypdf. Extract text, merge, split, rotate and reorder pages, edit metadata, add a watermark and encrypt a PDF. Runs live.
  6. 68 Lever des exceptions Learn to raise exceptions in Python with raise, choose the right exception type, re-raise errors you can't handle, and chain exceptions with raise ... from.
  7. 69 Exceptions personnalisées Create your own exception classes in Python by subclassing Exception, add extra data, design an exception hierarchy, and handle exception groups with except*.
  8. 70 Gestionnaires de contexte Understand how Python's with statement works, write context managers with __enter__ and __exit__ or contextlib.contextmanager, and use suppress and ExitStack.
  9. 71 Débogage et assert Learn to debug Python code. Read tracebacks from the bottom up, use print debugging well, check assumptions with assert, log with the logging module, and meet pdb.
  10. 72 Journalisation et avertissements Set up real logging in Python with loggers, handlers, formatters and dictConfig, log to files, and use the warnings module for deprecations and soft problems.
  11. 73 Zip, Tar et compression Create and read archives in Python. Use zipfile, tarfile, gzip and shutil.make_archive, extract files safely and compress data in memory.

Object-Oriented Programming

  1. 74 Classes et objets Start object-oriented programming in Python. Define classes, create objects, set attributes in __init__, write methods with self, and use class attributes.
  2. 75 Méthodes d'instance, de classe et statiques Learn the three kinds of methods in Python classes, when to use @classmethod and @staticmethod, and how to build clean alternative constructors.
  3. 76 L'héritage Learn Python inheritance step by step - create subclasses, override methods, extend them with super(), check types with isinstance, and understand the MRO.
  4. 77 Méthodes spéciales (dunder) Make your Python classes feel built in. Learn __str__ and __repr__, comparisons, __len__, __getitem__, iteration and operator overloading with clear examples.
  5. 78 Les propriétés Use Python's @property to create computed attributes, validate values with setters, make read-only attributes and keep a clean public interface for your classes.
  6. 79 Classes de données Learn Python data classes - let @dataclass write __init__, __repr__ and __eq__, set defaults safely with field(), and make frozen, ordered and slotted classes.
  7. 80 Classes abstraites et protocoles Define interfaces in Python with abstract base classes (abc), understand duck typing, and describe expected methods structurally with typing.Protocol.
  8. 81 Les énumérations Replace magic strings and numbers with Python enums. Learn Enum, auto(), StrEnum, IntEnum, Flag, looking up members, adding methods and using enums in match.
  9. 82 Principes de la POO : encapsulation, polymorphisme et abstraction Apply core OOP principles in Python. Learn encapsulation with _ and __ name mangling, polymorphism and duck typing, abstraction, composition vs inheritance.
  10. 83 Métaclasses, descripteurs et rouages internes des objets Look inside Python objects. Learn how __dict__ and attribute lookup work, save memory with __slots__, write descriptors, and meet metaclasses.

Beyond the Basics

  1. 84 Annotations de type Learn Python type hints - annotate variables and functions, use list[int], unions with |, Optional, TypedDict, Literal and generics, and check code with mypy.
  2. 85 Programmation asynchrone avec asyncio Learn async programming in Python with asyncio. Write coroutines with async and await, run work concurrently with tasks, gather and TaskGroup, and add timeouts.
  3. 86 Threads, processus et concurrent.futures Learn when to use threads, processes or asyncio in Python. Understand the GIL, avoid race conditions with locks, and run jobs with ThreadPoolExecutor.
  4. 87 Tests avec unittest et doctest Learn to test Python code with unittest and doctest. Write test cases, use assertions, check exceptions, share setup, and read test failures with confidence.
  5. 88 Environnements virtuels et mise en place d'un projet Set up real Python projects. Create virtual environments with venv, install packages with pip, pin requirements, lay out folders and describe it all in pyproject.toml.
  6. 89 Programmes en ligne de commande avec argparse Build real command-line tools in Python. Read sys.argv, define arguments and options with argparse, add subcommands and help text, and return proper exit codes.
  7. 90 Interfaces graphiques de bureau avec tkinter Build desktop apps with tkinter. Create windows and widgets, lay them out with pack and grid, handle events, use variables and timers, and build a to-do app.
  8. 91 Graphismes avec Turtle Learn Python's turtle module. Move, turn and draw shapes with loops, use colors and fills, handle key presses, and try the ideas live with a plotting stand-in.
  9. 92 Frameworks d'interface graphique Python : Kivy, PyQt et Streamlit Compare Python GUI frameworks. See Kivy, PySide6/PyQt, wxPython and Streamlit code side by side, learn signals and the rerun model, and pick the right toolkit.
  10. 93 Écrire du code pythonique Write Python the way experienced developers do. Learn PEP 8 style, the Zen of Python, everyday idioms like enumerate and unpacking, and the anti-patterns to avoid.
  11. 94 Mesurer et améliorer les performances Make Python code faster the right way. Time code with timeit, find hotspots with cProfile, pick the right data structures, save memory with generators, and cache results.
  12. 95 Gestion de la mémoire See how Python manages memory. Learn how names reference objects, how reference counting and the garbage collector free them, and use weakref and getsizeof.
  13. 96 Tester avec pytest Learn pytest from the ground up. Write plain assert tests, share setup with fixtures, run many cases with parametrize, mock dependencies, and measure coverage.
  14. 97 Vérification statique des types avec mypy Learn to check Python types with mypy. Run the checker, read its errors, narrow Optional values, write generics and Protocols, and configure strict mode in pyproject.toml.
  15. 98 Empaqueter et publier une bibliothèque Learn to package a Python library. Use the src layout, write pyproject.toml, build a wheel and sdist with build, test the install, and publish to PyPI with twine.
  16. 99 Python sécurisé : secrets, hachage et injection Write safer Python. Generate tokens with secrets, hash and verify passwords, sign data with hmac, avoid pickle risks, and stop SQL and command injection.
  17. 100 Nouveautés de Python 3.13 A practical tour of Python 3.13 - the new interactive shell, experimental free-threaded mode and JIT, copy.replace, warnings.deprecated, TypeVar defaults, removed modules and what changed afterwards.

Data and the Web

  1. 101 Réseau : URL, HTTP et sockets Learn how Python programs talk over the network. Parse and build URLs with urllib.parse, understand HTTP, call APIs with urllib and requests, and meet sockets.
  2. 102 Bases de données avec sqlite3 Store and query data with Python's built-in sqlite3 module. Create tables, insert and select rows, use safe parameters, handle transactions and read rows by name.
  3. 103 MySQL et PostgreSQL depuis Python Connect Python to MySQL and PostgreSQL. Learn the DB-API, choose a driver, use the right placeholders, manage transactions and pool connections.
  4. 104 ORM avec SQLAlchemy Learn SQLAlchemy 2.0. Run Core queries, define ORM models with Mapped[], use sessions and relationships, avoid N+1 queries and migrate with Alembic.
  5. 105 Bases de données documentaires avec MongoDB Use MongoDB from Python with PyMongo. Learn documents and collections, CRUD, query and update operators, indexes and the aggregation pipeline.
  6. 106 Développement web avec Flask et Django Discover how Python builds websites and APIs. Learn what web frameworks do, how WSGI, routing and templates work, and compare Flask, Django and FastAPI.
  7. 107 Les templates avec Jinja2 Learn Jinja2 in plain Python. Render variables, filters, loops, macros and template inheritance, escape user input safely, add custom filters and see how Flask uses it.
  8. 108 Les ressources Flask-RESTful Build REST APIs with Flask-RESTful. Write Resource classes, route them with Api.add_resource, parse arguments with reqparse, shape output with marshal_with and test everything.
  9. 109 Les bases de NumPy Learn NumPy from scratch. Create arrays, read shapes and dtypes, do vectorized math, slice and filter with masks, use broadcasting and compute aggregates.
  10. 110 Les bases de pandas Learn pandas step by step. Build Series and DataFrames, read CSV data, select and filter rows, add columns, sort, group with groupby and handle missing values.
  11. 111 Tracer des graphiques avec Matplotlib Learn Matplotlib step by step. Draw line, bar, scatter, histogram and pie charts, add labels and legends, build subplots, apply styles and save figures.
  12. 112 Graphiques statistiques avec Seaborn Learn Seaborn step by step. Draw histograms, box plots, scatter plots with hue, bar charts with error bars, heatmaps and pair plots from pandas DataFrames, then style them with themes.
  13. 113 Apprentissage automatique avec scikit-learn Learn machine learning in Python with scikit-learn. Split data, train classifiers and regressors, measure accuracy, build pipelines, cross-validate and spot overfitting.
  14. 114 Gradient boosting avec XGBoost et LightGBM Train, tune and compare XGBoost and LightGBM on a tabular dataset in Python. Learn n_estimators, learning_rate, early stopping, feature importance and a fair comparison with scikit-learn.
  15. 115 Réseaux de neurones : TensorFlow et PyTorch en un coup d'œil Understand neural networks in Python. Build and train a tiny network with NumPy, see how PyTorch and Keras code looks, and learn when deep learning is the right tool.
  16. 116 Envoyer des e-mails avec smtplib et email Send email from Python. Build messages with EmailMessage, add HTML and attachments, connect securely with smtplib and test with a local debug server.
  17. 117 Le web scraping avec requests et BeautifulSoup Learn web scraping in Python. Fetch pages with requests, parse HTML with BeautifulSoup, select elements with CSS selectors, and scrape politely with robots.txt.
  18. 118 Explorer le web avec Scrapy Learn web crawling with Scrapy. Write spiders, extract data with CSS and XPath selectors, follow links and pagination, clean items in pipelines, and crawl politely.
  19. 119 Traitement d'images avec Pillow Learn image processing in Python with Pillow. Create and open images, resize and crop, convert to grayscale, apply filters, draw shapes and text, and save in other formats.
  20. 120 La vision par ordinateur avec OpenCV Learn OpenCV with Python. Create and inspect images as NumPy arrays, convert colors, resize, blur, threshold, detect edges and count shapes with contours, with runnable examples.
  21. 121 Jeux avec pygame Learn pygame basics in Python. Build the game loop, handle keyboard and quit events, draw shapes, use Rect and Sprite classes, detect collisions and keep logic testable.
  22. 122 API REST avec FastAPI Learn FastAPI step by step. Build typed routes, path and query parameters, Pydantic request bodies, validation errors, dependencies and async endpoints in Python.
  23. 123 Authentification FastAPI : hachage de mots de passe, JWT et OAuth2 Secure a FastAPI app. Hash passwords with bcrypt, issue and verify JWT access tokens, build the OAuth2 password flow, add role checks, and learn when CSRF matters.
  24. 124 Tâches en arrière-plan avec Celery et RQ Learn task queues in Python. Understand brokers, workers and result backends, write Celery tasks with retries, chains and groups, schedule jobs with beat, and compare Celery with RQ.
  25. 125 Automatisation du navigateur avec Selenium et Playwright Control a real browser from Python with Selenium and Playwright. Learn locators, waits, forms and the page object pattern, and practice selectors and waiting live.
  26. 126 Déployer des applications web Python Learn how to take a Python web app live. Understand WSGI and ASGI, run Gunicorn or Uvicorn behind a proxy, read settings from the environment, package with Docker and pick a host.
  27. 127 Traitement automatique du langage avec NLTK et spaCy Learn natural language processing in Python. Tokenize and clean text, stem words, count n-grams, compare documents with TF-IDF, and meet spaCy pipelines and entities.
  28. 128 Python pour l'Internet des objets (IoT) Use Python for Internet of Things projects - Raspberry Pi with GPIO Zero, Arduino with pyFirmata, ESP32 with MicroPython, and MQTT messaging, with runnable simulations.
  29. 129 Python dans le cloud : AWS, Azure et serverless Use Python with cloud platforms - AWS boto3, the Azure SDK, serverless functions, retries, pagination and testing cloud code without credentials using runnable fakes.
  30. 130 Python pour la cybersécurité Learn how security professionals use Python - port scanning with sockets, packet crafting with Scapy, SSH automation with Paramiko, packet parsing and log analysis - with runnable examples.

Projects

  1. 131 Projet : Pierre, feuille, ciseaux Build rock, paper, scissors in Python step by step. Practice input, random choices, a rules dictionary, input validation, score keeping and best-of-N matches.
  2. 132 Projet : Jeu de devinette de nombre Build a complete number guessing game in Python, step by step. Practice random numbers, loops, input validation, functions, difficulty levels and replay stats.
  3. 133 Projet : Morpion Build tic-tac-toe in Python step by step, from a list-based board and validated moves to win detection, a rule-based computer player and an unbeatable minimax AI.
  4. 134 Projet : Analyseur de texte Build a text analyzer in Python step by step. Count words and sentences, find the most common words with Counter, estimate readability and print a clean report.
  5. 135 Projet : Système bancaire Build a banking system in Python step by step. Use classes, inheritance, Decimal money, custom exceptions, transaction history and safe transfers, then test it with unittest.
  6. 136 Projet : gestionnaire de stock Build an inventory manager in Python with data classes, custom exceptions, reports, JSON saving and a command-line interface driven by pattern matching.
  7. 137 Projet : rapport de données Build a data report in Python from a CSV file. Clean messy rows, group and total the data, compute statistics, chart trends in text and save the finished report.
  8. 138 Projet : analyse de sentiment Build a sentiment classifier in Python. Clean text, count words, vectorize reviews with TF-IDF, train logistic regression with scikit-learn, evaluate it, find its mistakes and wrap it in a function.
  9. 139 Projet : API JSON avec Flask Build a JSON REST API with Flask step by step. Add CRUD routes, input validation, JSON error handlers, filtering and pagination, then test it with the Flask test client.
  10. 140 Projet : application web de tâches Build a to-do web app with Flask and SQLite. Render HTML templates, handle forms with POST and redirect, edit and delete tasks, escape user input, add CSRF protection and test it all.
  11. 141 Automatisation du bureau : capture d'écran, pyautogui, synthèse vocale Automate your desktop with Python. Take screenshots, record the screen to a GIF, control mouse and keyboard with pyautogui and speak text. Includes runnable stand-ins.
  12. 142 Final project: Build a Command-Line Study Tracker Build a small command-line study tracker step by step in Python, with input checks, totals, JSON saving, simple tests and a Git history of your work.

Data Structures and Algorithms

  1. 143 Piles, files, tas et listes chaînées Build classic data structures in Python. Use lists as stacks, deque as a queue, heapq for priority queues, and build a linked list and a binary search tree.
  2. 144 Algorithmes de recherche et de tri Learn classic Python algorithms, including linear and binary search, bisect, bubble, insertion, merge and quick sort, and measuring Big-O by timing your code.
  3. 145 Bibliothèques de structures de données en plus : sortedcontainers, treelib, intervaltree, pygtrie Go beyond lists and dicts. Use sortedcontainers for always-sorted data, treelib for trees, intervaltree for ranges and pygtrie for prefix lookups, with runnable examples.
  4. 146 Complexité des opérations natives Learn the Big O cost of Python's built-in operations on list, dict, set, deque, str and heapq, see why some are O(1) and others O(n), and pick the right type.

Practice and Review

  1. 147 Aide-mémoire Python A one-page Python cheat sheet with syntax, strings, lists, dicts, sets, loops, functions, classes, errors, files, f-string formats and the most-used built-ins.
  2. 148 Exercices pratiques Python 27 graded Python exercises with solutions on strings, loops, dictionaries, functions, files, classes, generators and algorithms. Run them in your browser.
  3. 149 Programmes Python classiques Work through the short Python programs every learner meets - maximum, interest, Armstrong numbers, primes and sieve, Fibonacci, list rotation and swapping, and date arithmetic.
  4. 150 Questions d'entretien Python 38 common Python interview questions with concise answers, from lists vs tuples and scope to generators, decorators, the GIL, memory and metaclasses.