Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 146 - 2609_Logicode
P. 146

    21 st   #Critical thinking
                                                                                                 Century
                      7.  Competency-based/Application-based questions.                           Skills  #Technology Literacy
                          a.   Yash made a list in Python and forgot to add a couple of elements to it. Which function can he use
                             to add these elements?

                          b.   Mira wants to receive a string from the user and change the first letter of the string to uppercase
                             before saving it to a variable. How can she achieve this in Python?

                          c.   Aadya created multiple strings in Python. She now wishes to join the strings to form a single string.
                             Is this possible? How can she do this?

                          d.   Nimit wants to create a list of students’ names and their percentage. He then wants to combine all
                             the list into one list for example: [ [‘Avinay’, 78], [‘Shrey’, 89], [‘Vinod’,76] ]. Is it possible to create
                             a list in another list? If yes, what is it called?
                          e.   Pratha has created a list of her friends as Party =[Vinay’, ‘Ranu’, ‘Krish’ and ‘Yashik’] coming to
                             your birthday party. But ‘Yashik’ cancelled last minute and ‘Mridul’ agreed. Help Pratha by telling
                             her how to add and remove her friends’ name from the list.

                                                                                                       21 st   #Critical thinking
                         LAB ACTIVITY                                                               Century   #Technology Literacy
                                                                                                      Skills

                          Visit your computer lab and perform the following actions:
                              Write a python program for the given list numbers = [12, 7, 25, 30, 18, 5] which gives output as:

                            Even: [12, 30, 18]
                            Odd: [7, 25, 5]

                          The program separates and creates two different list of Even and Odd numbers.

                              Write a python program to search "Bag" in the list:

                            items = ["Pen", "Book", "Bag", "Bottle"]
                            and return the output as "Item Found"

                               In the list given below edit it and only display numbers that are divisible by 4. If there is a
                            number greater than 100, then stop the loop iteration.
                            list = [8, 13, 16, 24, 35, 50, 60, 72, 75, 100, 120, 160]

                              Write the output of the given python program:

                            sentence = "I enjoy coding using Python."

                            count = 0

                            for ch in sentence.lower():
                                if ch in "aeiou":

                                    count += 1

                            print("Number of vowels:", count)

                      144   Premium Edition-VIII

| 141 142 143 144 145 146 147 148 149 150 151 |