Page 124 - Trackpad_V2.1_class8
P. 124

b.  Define strings.

                         ______________________________________________________________________________
                      c.  What are lists in Python? Define any two list functions.

                         ______________________________________________________________________________

                         ______________________________________________________________________________
                      d.  How can we call a function in Python? Explain using an example.
                         ______________________________________________________________________________

                         ______________________________________________________________________________

                         ______________________________________________________________________________

                         ______________________________________________________________________________
                      e.  What are the different types of functions? Explain in detail.

                         ______________________________________________________________________________

                         ______________________________________________________________________________

                         ______________________________________________________________________________
                         ______________________________________________________________________________

                      f.  Consider the following list:
                         L = [3, 5, 7, 9, 12, 15]

                         Write the Python code to find the position of the even number in the given list.
                         ______________________________________________________________________________

                         ______________________________________________________________________________

                         ______________________________________________________________________________

                                                                                                   21 st   #Critical Thinking
                  5.  Application-based questions.                                              Century
                                                                                                  Skills  #Technology Literacy
                      a.   Devansh created multiple strings in Python. He now wishes to join the strings to form a
                         single string. Is this possible? How can he do this?
                      b.   Kazim made a list in Python and forgot to add a couple of elements into it. Which function
                         can he use to add these elements?
                  6.  Write the output for the following codes in Python:
                     a.  test_str = "Good Morning"

                      print("The original string is : " + test_str)
                      hlf_idx = len(test_str)
                      res = ' '

                      for idx in range(len(test_str)):
                        if idx >= hlf_idx:
                             res+= test_str[idx].upper()




                  122   Trackpad (V2.1)-VIII
   119   120   121   122   123   124   125   126   127   128   129