gs gs109 Python OOPs - Python Encapsulation - Quiz No.2

gs gs109 Python Quiz

Online Quizzes Preparation

This quiz belongs to book/course code gs gs109 Python of gs organization. We have 134 quizzes available related to the book/course Python. This quiz has a total of 4 multiple choice questions (MCQs) to prepare and belongs to topic Python OOPs. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.

NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.

Question 1: What will be the output of the following Python code?

 class fruits: def __init__(self): self.price = 100 self.__bags = 5 def display(self): print(self.__bags) obj=fruits() obj.display() 
Question 2: What will be the output of the following Python code?

 class student: def __init__(self): self.marks = 97 self.__cgpa = 8.7 def display(self): print(self.marks) obj=student() print(obj._student__cgpa) 
Question 3: Which of the following is false about protected class members?
Question 4: What will be the output of the following Python code?

 class objects: def __init__(self): self.colour = None self._shape = "Circle"  def display(self, s): self._shape = s obj=objects() print(obj._objects_shape) 


Online Quizzes of gs109 Python

Other LANG related online quizzes

Other categories of gs Online Quizzes

Other organizations

Theme Customizer

Gaussian Texture



Gradient Background