Page 53 - Touhpad Ai
P. 53

The file will be saved by the given name at the specified location.

                 Run a Program
                 Follow these steps to run a Python program:
                 Step 1   Click on the Run menu in the Menu bar. Alternately, press F5 to run the program.
                 Step 2   Select on the Run Module option.















                 The program will execute and the output will be shown in the Shell window.


















                Input and Output

                 Python provides two commonly used functions input() and print() for input and output.

                 u  The input() Function: The input() function takes the user’s input while a program executes. When called, it waits
                   for the user to type something on the keyboard and press the Enter key. The function then returns the user input as a
                   string. The syntax of the input() function is as follows:
                   input([<prompt>])
                    Where, prompt is the string or message we wish to display on the screen.


                                                                                 Basic Concepts of Artificial Intelligence  51
   48   49   50   51   52   53   54   55   56   57   58