Page 1 of 1

Question 4 Consider the code: class Fruit: definit__(self, weight, sweetness, colour): self.weight = weight self.sweetne

Posted: Thu May 05, 2022 12:51 pm
by answerhappygod
Question 4 Consider The Code Class Fruit Definit Self Weight Sweetness Colour Self Weight Weight Self Sweetne 1
Question 4 Consider The Code Class Fruit Definit Self Weight Sweetness Colour Self Weight Weight Self Sweetne 1 (35.38 KiB) Viewed 31 times
Question 4 Consider the code: class Fruit: definit__(self, weight, sweetness, colour): self.weight = weight self.sweetness = sweetness self.colour = colour What is the purpose of line 3, self.weight = weight? Nothing Stores the value of the parameter weight as an attribute of self. It makes 'weight' the default value of the attribute weight. Submit Submit