Post

@PythonPr Answer: 17
The code creates an object of the Book class and sets its price.
First, an instance obj of the Book class is created.
Then, the set_price(15) method is called on the obj instance. Inside this method, self._price is set to 15 + 1, which is 16.
English

@PythonPr 1. obj.set_price(15) calls on the set_price method resulting into a value 16 getting saved in the callers
2. print(obj.get_price()) calls on the get_price method which fetches the value 16 in the callers and adds to 1 to returns 17
3. Output on the console will be 17
English

@PythonPr Ans. 17
@ set__price() __price = 16
@ get__price() return 17
English

@PythonPr 17 because in the first function of the Book class, val returns 15, so 15 + 1 = 16, and in the second function, there is a return from the first function, which is 16, so 16 + 1 = 17.
English

@PythonPr 17 parce que il ya incrémentation de +1 ..au niveau de la valeur 15 ...
Quand il appel la classe il donne un nombre .. au niveau de la variable Val.. ensuite il ajoute 1.
Ensuite il appel de nouveau... la nouvelle valeur 16 ..qui nous donne un résultat 17
Français
















