New ! Computer Science MCQ Practise Tests



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

12th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 01:30:00 Hrs
Total Marks : 36

    3 Marks

    12 x 3 = 36
  1. Write a note on object.

  2. Write a note on self argument used in python class function.

  3. Write a python program to find total and average marks using class.

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

  5. Write the output 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)

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

  7. Write a python program that illustrate the use of destructor.

  8. 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

  9. 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?

  10. Write a program to define a class and syntax for class instantiation
    class Sample:
    #class variables
    x, y = 10, 20
    S = Sample() #class instantiation
    print ("value of_x=", S.x)
    print ("value of_y=", S.y)
    print ("value of x and y =", S.x + S.y)

  11. Write a program to illustrate class variable to keep count of objects created. 

  12. Write a Program to illustrate private and public variables.

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

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

Write your Comment