Explain Codes LogoExplain Codes Logo

Python

Finding the average of a list

python
performance
statistics
numpy

Why does "return list.sort()" return None, not the list?

python
list-sort
method-chaining
timsort

How to print without a newline or space

python
printing
string-formatting
buffering

How do I print colored text to the terminal?

python
colorama
curses
terminal-ui

How to uninstall Python 2.7 on a Mac OS X 10.6.4?

python
uninstall
macos
dependencies

How can I replace (or strip) an extension from a filename in Python?

python
file-handling
pathlib
extensions

How do I change the size of figures drawn with Matplotlib?

python
matplotlib
data-visualization
pandas

How to Check if One of the Following Items Is in a List?

python
sets
any
generator-expressions

How to check Django version

python
django
version-check
virtual-environment

How can I make a Python script standalone executable to run without ANY dependency?

python
packaging
pyinstaller
cross-platform

Importing files from different folder

python
sys-path
absolute-imports
best-practices

How do I split the definition of a long string over multiple lines?

python
string-management
best-practices
sql-injection

Savefig outputs blank image

python
matplotlib
data-visualization
subplots

Speed comparison with Project Euler: C vs Python vs Erlang vs Haskell

python
performance
optimization
memory-management

Getting the class name of an instance

python
class-name
type-method
instance

Use of *args and **kwargs

python
args
kwargs
decorators

What is the difference between venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv, etc?

python
venv
pipenv
virtualenv

Convert string to Python class object?

python
eval
input-validation
dynamic-import

How do I reverse a string in Python?

python
string-manipulation
slicing
performance

How to repeatedly execute a function every x seconds?

python
scheduling
asyncio
threading