Загрузка...

Why You Shouldn't Use Triple Quotes for Comments in Python

In this video, we’ll discuss why using triple quotes for comments in Python is not considered good practice. While triple quotes are intended for docstrings—documentation strings that describe the functionality of functions, classes, or modules—using them for general comments can lead to confusion and unintended behavior in your code.

We’ll look at why it's better to use the hash symbol (#) for comments and save triple quotes for docstrings. You’ll also learn how Python treats these strings differently and how it impacts memory usage.

What You’ll Learn:

Why triple quotes should be reserved for docstrings.
The difference between comments and docstrings in Python.
The impact of using triple quotes for comments on Python's memory usage.
Best practices for writing comments in Python.

Видео Why You Shouldn't Use Triple Quotes for Comments in Python канала Code With Amulya
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять