#python

Found 36 articles tagged with #python

How to print colored terminal text in Python

While traditional terminal output is often monochromatic, introducing colors allows developers to convey information more effectively and intuitively.

Mar 06, 2024#python#cli

How to Summarize Text Using Machine Learning and Python?

ML algorithms can be used to create intelligent systems that can analyze and reduce large materials into brief summaries. This will save time and improve comprehension as well.

Feb 19, 2024#AI#ML#python

How to sleep or delay n seconds in Python

In programming, sleeping or delaying execution refers to intentionally pausing the execution of a program for a specified period of time.

Feb 19, 2024#python#async

How to add Python to PATH on macOS, Linux, Windows

Adding Python to the PATH allows you to run Python commands or scripts from any location in the command prompt or terminal without specifying the full path to the Python executable.

Feb 18, 2024#python#cli

Advanced string formatting with f-strings in Python

F-strings (formatted string literals), introduced in Python 3.6, are a way to embed expressions inside string literals, using curly braces.

Feb 15, 2024#python#strings

How to iterate through a dictionary in Python

There are several ways to iterate through a dictionary depending on what you want to access: the keys, the values, or the key-value pairs.

Feb 13, 2024#python

How to check if variable is None in Python

None is a special data type in Python that represents the absence of any value or object. It is not the same as 0, False, or an empty string.

Feb 08, 2024#python#operators

How to use list comprehension in Python

List comprehension is a concise way of creating lists in Python based on an existing iterable object, such as a list, a tuple, a string, or a range.

Jan 05, 2024#python#lists

How to use type hints in Python

Type hints don't enforce type checking at runtime, but they provide valuable information for static type checkers, code completion, and code clarity for developers.

Jan 03, 2024#python#types

Difference between *args and **kwargs in Python

In summary *args collects the extra positional arguments as a tuple, while **kwargs collects the extra keyword arguments as a dictionary.

Jan 02, 2024#python#functions