Page 348 - Artificial Intellegence_v2.0_Class_9
P. 348

Ready                                                                         4






        Answer the following questions:

            1.  Create a Python list with the elements 1, 2, 3 and replace the second element with 'Python'. Also, add element 5 at the
              end of the list.

              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..
              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..

              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..

              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..
              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..

               ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..
              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..

              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..
              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..

              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..

              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..
               ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..

              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..
            2.  Write a Python program that reverses a given sentence. For example, if the input is "Hello, World!", the program should
              output "!dlroW ,olleH".
              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..

              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..
              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..

              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..

              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..
               ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..

              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..
              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..

              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..
              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..

              ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..

               ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..
               ……………………….……………………….……………………….……………………….…………………......................…….………………………………………..

              346     Touchpad Artificial Intelligence (Ver. 2.0)-IX
   343   344   345   346   347   348   349   350   351   352   353