> For the complete documentation index, see [llms.txt](https://til.devjugal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://til.devjugal.com/python/execute-python-code-in-command-shell.md).

# Execute Python Code In Command Shell

We can run Python Code in shell using `python -c` option.

## Example

```bash
python3 -c "print('Hello World')"
Hello World
```

***Source:*** [***Python Docs***](https://docs.python.org/3/using/cmdline.html#cmdoption-c)
