We can run Python Code in shell using python -c option.
python -c
$ python3 -c "print('Hello World')" Hello World
Source: Python Docs
Last updated 3 months ago