Page 189 - AI Ver 1.0 Class 10
P. 189

Multiple Statements
                 Multiple statements mean more than one statement in a single line. This can be done by separating the
                 statements using semicolons (;). For example:








                 Comments
                 Comments are used to increase the readability of the code. We use it to give proper understanding of the code in
                 simple English statements. They are completely ignored by the Python interpreter and do not display or affect the
                 output of the code. It is always a good practice to add comments in your code so that if anybody in future wish to
                 understand or modify your code then through comments it become easy to know what you have written in a code.
                 In Python we can give two different kind of comments. Let us discuss about them.



                 Single Line Comments
                 Starts with a hash symbol ‘#’ followed by the text to be written as a comment that lasts till the end of the line.
                 For example:











                 Multi Line Comments
                 When we add up comments which occupy two or more lines then we begin the comment with either 3 times
                 single quotes ‘'' or double quotes ""“, followed by text on multiple lines and end with 3 times single quotes ‘'' or
                 double quotes “““to mark the end of the comment.
                 For example:













                                                                                           Advance Python   187
   184   185   186   187   188   189   190   191   192   193   194