- use Python Interpreter to directly execute Python statements,
- create a Python script file (*.py) and run it from the command prompt,
- or use a Python editor like PyCharm.
C:\Users\admin>python Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) Type "help", "copyright", "credits" or "license" for more information. >>> 2+2 4
>>> print("Hello World!") Hello World!
If you want to create more complex programs and save your work, you can use a Python script file. Script files allow you to save your code and execute the same code later when you need it.
C:\Users\Your Name>python HelloWorld.py Hello World!
Alternatively, you might prefer to use an IDE (Integrated Development Environment) for Python development. An IDE offers you a productive development environment.
PyCharm is one of the top IDEs for Python. PyCharm is a cross-platform development environment created by Jet Brains. It allows developing Python programs faster by tools like syntax highlighting, automatic code completion, builder and debugger. You can download the free Community edition of PyCharm from https://www.jetbrains.com/pycharm/download/.
By default, the project location is set to C:\Users\User Name\PycharmProjects\untitled but you can change it. Make sure that Base interpreter shows the correct Python installation. Then click Create button.