Page 346 - AI Ver 1.0 Class 9
P. 346

S. No                          Questions                                      Answers
             44     Give the output of the following:                          S T R I N G S
                    Str="STRINGS"
                    for i in Str:
                          print(i,end=" ")

             45     What will be the output of the following code?             [100, 300, 400, 0]
                    L1=[100,200,300,400]
                    L1.pop(L1.index(200))
                    L1.append(L1.count(200))
                    print(L1)
             46     What will be the output of the following code?             [20, 40, 60, 20]
                    num=[10,20,30]+[40,50,60]
                    print(num[1::2]+num[1:2])
             47     What will be the output of the following code?             [10, 1, 2]
                    L1=[10,20,30,40]
                    L1.pop()
                    L1.pop(2)
                    L1.remove(20)
                    L1.extend([1,2])
                    print(L1)

             48     What will be the output of the following code?             xyz
                    friends=["abc","xyz","adx"]
                    ch=1
                    print(friends[ch])
             49     Which of the following is not a keyword?                   print

                    a) if
                    b) for
                    c) print
                    d) or

             50     Which of the following are invalid strings?                c)  b) & c)
                    a) "hello friends"
                    b) "Hope you are liking ‘Python’ Language"
                    c) "I am "Sure" you will enjoy"
                    d) 'Enjoy!!'
                    Options are:
                    a)  a)  &  b)
                    b)  b)
                    c)  b) & c)
                    d)  d)







                  344   Touchpad Artificial Intelligence-IX
   341   342   343   344   345   346   347   348   349   350   351