Page 343 - AI Ver 1.0 Class 9
P. 343

S. No                           Questions                                      Answers
                 24    What will be the output of the following code?              15 -5

                       x,y=5,10
                       x,y=x+y,x-y
                       print(x,y)
                 25    What will be the output of the following code?              15 10

                       a,b,c=5,10,15
                       a+b;a+=b
                       print(a,b)

                 26    What will be the output of the following code?              5 0 50
                       a,b=5,10
                       c,b=a*b,a//b

                       print(a,b,c)
                 27    What will be the output of the following code?              202.0
                       x,y,z=12,10,5

                       n=x//z+y**3/z
                       print(n)
                 28    What will be the output of the following code?              [10, 20, 30, 40, 50, 40, 50, 40, 50]

                       a=[10,20,30]                                                [10, 20, 30, 40, 50]
                       b=[40,50]

                       print(a+b*3)
                       print(a+b)

                 29    What  is  the  order  of  precedence  of  the  given  arithmetic
                       operators (in ascending order)?
                                                                                    1     **
                       +
                                                                                    2     /  %    //   *
                       -
                                                                                    3      - +  (Binary)
                       *
                       /
                       %
                       //
                       **

                 30    What will be the output of the following code?              [1, 20] [3, 4] [1, 20]
                       a, b=[1,2],[3,4]
                       c=a

                       c[1]=20
                       print(a,b,c)





                                                                             Python Practical Questions  341
   338   339   340   341   342   343   344   345   346   347   348