Page 115 - Plus V4 with Adobe class 8
P. 115

Double Tap                                                   Century   #Information Literacy
                                                                                   21 st
                                                                                  Skills
                  1.  Write any two components of Python function.



                  2.  Write the main difference between built-in and user-defined functions.





                      Interdisciplinary Learning

                      #Mathematics

              Create a Python program to find the HCF and LCM of two numbers using function.


                                                                                                       #Lab Activity


                 STRING


            A sequence of characters which is enclosed or surrounded by single (‘ ’) or double (“ ”) quotes is known
            as a string. The sequence may include a letter, number, special characters or a backslash. Python treats
            single quotes as double quotes.

            Example of a string:










            Creating Strings


            Strings can be created by enclosing characters inside single or double quotes. It is like assigning a value
            to a variable.
            Multiline Strings


            A multiline string in Python begins and ends with either three single quotes or three double quotes. Any
            quotes, tabs, or newlines in between the “triple quotes” are considered part of the string.

             Program 3: To create a string













                                                                                  #Functions and String in Python 113
   110   111   112   113   114   115   116   117   118   119   120