Page 132 - TP_Prime_v2.2_Class_6
P. 132

A new file opens.

                  Step 2:  Write your code.








                                                    Creating a Program in Script Mode
           Prime (Ver. 2.2)-VI  Step 4:  Once the file is saved, click on the Run à Run Module option.
                  Step 3:  Save your file. Ensure the file is saved with the .py extension.













          130                                               Running a Program
                  Output appears in the Python Shell window.
















                                                      Output on Python Shell window

                   The input( ) and print( ) Functions


                  Python  provides two commonly  used  functions  input()  and  output()  for  taking  input  and
                  displaying output. Let's learn about these in detail.


                    The print() Function

                  The  print(  )  function  is  used  to  display  messages  defined  by  the  user  on  the  screen.
                  The print( ) function can also be used to return the output of any expression after the

                  processing. It can be used in both interactive and script modes.













                                                          Using print() Function
   127   128   129   130   131   132   133   134   135   136   137