Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 143 - 2612 Digimind C6
P. 143

    Example:

                     Program: #print three names
                                print("Roli")
                                print("Proloy")
                                print("Devansh")
                     Output: Roli Proloy Devansh
                     However, the text written inside triple quotes (''' or " " ") is also considered a comment. You can
                     use the triple quotes to write multiline comments. For example:
                     '''
                     This is a multiple-line comment that spans two lines in Python.
                     '''

                                              Write 'T' for True and 'F' for false.
                                              1.  Variables are memory reference points where we store values.
                             uiz   Bee        2.  An integer is a collection of one or more characters put in single

                                                or double-quotes.

                               SAVING A PYTHON PROGRAM

                     To save a Python program, follow the steps given below:

                              1  Click on the File menu.

                            2  Click on Save option.     3  Type the name of the file in   4  Click on the Save button.
                                                        the File name: box.

                     The file will be saved with the .py extension and ready to be executed
                                                                                                Short key  Ctrl +  S
                     as a Python script.                                                           To save a program:

                                                                                                 Introduction to Python  141

| 138 139 140 141 142 143 144 145 146 147 148 |