New ! Computer Science MCQ Practise Tests



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

12th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 01:00:00 Hrs
Total Marks : 10

    2 Marks

    5 x 2 = 10
  1. Write the general form of declaring class in Python.

  2. Write the syntax for the following
    (i) Creating objects
    (ii) Accessing class members

  3. Name the function which acts as a constructor and destructor.

  4. Write a program in python that illustrate the use of constructor.

  5. Explain the working of the following program
    class Sample:
    num=0
    def _init_(self) var):
    Sample.num+= 1
    self.var=var
    print("The object value is = ", var)
    print("The count of object created Sample.num) =",
    S1=Sample(15)
    S2=Sample(35)
    S3=Sample(45)

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

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

Write your Comment