Question 4 Consider the code: class Fruit: definit__(self, weight, sweetness, colour): self.weight = weight self.sweetne
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Question 4 Consider the code: class Fruit: definit__(self, weight, sweetness, colour): self.weight = weight self.sweetne
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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!