New ! Computer Science MCQ Practise Tests



Python Classes and Objects 2 Mark Creative Question Paper With Answer Key

12th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 01:00:00 Hrs
Total Marks : 26

     2 Marks 

    13 x 2 = 26
  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. Differentiate python class function and ordinary function.

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

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

  6. 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)

  7. Write a note on public and private data members of python class.

  8. How will you access the class members?

  9. What are self arguments?

  10. How will you declare a class variable?

  11. What are public members?

  12. What are private members?

  13. what is the output of the following program?
    Class Hosting:
    def_init_(self, name):
    Self._name = name
    def display(self):
    print("welcome to", self._name)
    obj = Greeting('Python programming')
    obi.display()

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

Reviews & Comments about 12th Standard Computer Science English Medium - Python Classes and Objects 2 Mark Creative Question Paper and Answer Key 2022 - 2023

Write your Comment