Python Cheat Sheet/Command-line one-liner

Command-line one-liner

Section: Basics and running code

Command-line one-liner

bash
bash
python -c "print(sum(range(10)))"

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Basics and running code
Run a module
Run a module
OpenIn sheetbashsame section
Print text
Print text
OpenIn sheetpythonsame section
Multiple assignment
Multiple assignment
OpenIn sheetpythonsame section
Swap variables
Swap variables
OpenIn sheetpythonsame section
Read input
Read input
OpenIn sheetpythonsame section
Integer division
Integer division