New ! Computer Science MCQ Practise Tests



12th Standard English Medium Computer Science Subject Python Classes and Objects Creative 3 Mark Questions with Solution

12th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 01:00:00 Hrs
Total Marks : 15

    3 Marks

    5 x 3 = 15
  1. Write a note on self argument used in python class function.

  2. Explain the working of the following program. class Sample:
    def _init_(self, num):
    print("Constructor of class Sample ...")
    self.num=num
    print("The value is :", num)
    S=Sample(10)

  3. Why the following program give an error while displaying the value of n2. Give Reason.

  4. Fill up the blanks in the following program to get the output:
    Value of x = 10
    Value of y = 20
    Sum of x and y= 30
    Class sample:
    x, __ = 10, 20 -------------------1
    s = -------------------------2
    print ("value of x =", __ ) ------------3
    print ("value of y =", __ ) -------------4
    print ("sum of x and y =", __ ) --------5

  5. Read the following program. Answer the following question. Class sample:
    x, y= 10, 20
    s= sample ()
    print (s. x + s. y)
    1. What does sample denotes?
    2. What does x, y denotes?
    3. What does s denotes?

*****************************************

Reviews & Comments about 12th Standard English Medium Computer Science Subject Python Classes and Objects Creative 3 Mark Questions with Solution

Write your Comment