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

Factbot

             There are around 700 separate programming languages. Some of the most popular ones are Javascript,
             Swift, Scala, Python, PHP, Go, Rust, Ruby, and C#.




                       Timeline


                      Functions help us to break our program into smaller parts or modules.
                      Python functions can be categorised into in-built functions and user-defined functions.
                       A sequence of characters that are enclosed or surrounded by single (‘ ’) or double (“ ”) quotes is known
                     as a string.






                   Choose the correct option.

                   1.  Which type of function is upper( )?
                            a.  Built-in                                  b.  User-defined

                            c.  Not a valid function                      d.  None of these

                   2.  What is the input given to the functions referred to as?
                            a.  Return Value                              b.  Name

                            c.  Arguments                                 d.  None of these

                   3.  Which of the following operators is used to concatenate two or more strings?
                            a.  &                                         b.  $


                            c.  *                                         d.  +

                   4.  Which of the following is used to insert special characters that are invalid in Python?
                            a.  Escape sequence                           b.  Strings

                            c.  Lists                                     d.  None of these

                   5.  Which operator is used to repeat the string for a given number of times?
                            a.  String Concatenation Operator             b.  String Replication Operator

                            c.  len()                                     d.  None of these

                   Fill in the blanks with the correct words.



                                             Hints  function, capitalize(), string, lower

                   1.   The  _______________ function returns a string with the first character in capital.
                   2.  A  _______________ can be defined as a block of a reusable code that performs a specific task.



                                                                                  #Functions and String in Python 119
   116   117   118   119   120   121   122   123   124   125   126