python

Python interactive shell


To start an interactive Python shell, you can use your terminal or command prompt. Here are the steps:

  1. Open Terminal or Command Prompt:
    • On Windows, you can open Command Prompt or PowerShell.
    • On macOS or Linux, you can open Terminal.
  2. Start Python:
    • Type python and press Enter. If you have Python 3 installed, you might need to type python3.

 

This will start the interactive Python shell. You should see something like this:

Python 3.x.x (default, Month Day Year, HH:MM:SS)
[GCC x.x.x] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Here, you can type Python commands and see the results immediately. For example:

>>> print("Hello, World!")
Hello, World!

 


python