Skip to content

Python Tutorials

Install Python on macOS

shell
brew install [email protected]
brew install [email protected]

Create a virtual env with a specific version of python

shell
python3.9 -m venv "my_env_name"
python3.9 -m venv "my_env_name"

for loop with index and value

python
for idx, x in enumerate(xs):
    print(idx, x)
for idx, x in enumerate(xs):
    print(idx, x)

Library