Page 51 - Touhpad Ai
P. 51

We can work on multiple programs in the same window.





















                           You  can  also  use  an online  Jupyter  Notebook through  Google  Colab  (This requires  login  through  your
                         Gmail account).


                 Modes in Python
                 In Python, particularly when using Python IDLE, there are two main modes in which you can work. These modes are
                 Interactive mode and Script mode.

                 Interactive Mode

                 Interactive mode allows you to enter Python commands directly into the command line shell and immediately see the
                 results. In Interactive mode, we type one command at a time. Interactive mode is useful for quick experimentation, testing
                 snippets of code, or exploring the behaviour of Python functions and modules. The Interactive mode does not save the
                 commands entered by the user in the form of a program.
                 Follow these steps to start Python IDLE and work in Interactive mode:

                 Step 1   Click on the Start button.
                 Step 2   Scroll down the list of programs and click on the Python 3.12 folder.

                 Step 3   Click on the IDLE (Python 3.12 64-bit) app.
                 The main IDLE window appears. It is a code editor which helps you to write and
                 execute Python programs in the editor itself.
                 There are two components of Python IDLE window:
                 u   Menu Bar: The Menu Bar of Python IDLE window is similar to the Menu Bar of
                   other programs. It has various menus such as File, Edit, Shell, Debug, Options,
                   Window and Help.
                 u   Prompt: You will see a symbol (>>>) in the window. This is known as the Prompt. The Prompt allows the user to
                   enter commands directly into Python and get an output instantly by pressing the Enter key.
                                                                  Menu bar






                                      Prompt








                                                                                 Basic Concepts of Artificial Intelligence  49
   46   47   48   49   50   51   52   53   54   55   56