Create a class called Cereal that accepts three inputs: 2 strings and 1 integer, and assigns them to 3 instance variables in the constructor: name, brand, and fiber. When an instance of Cereal is printed, the user should see the following: "[name] cereal is produced by [brand] and has [fiber integer] grams of fiber in every serving!" To the variable name c1, assign an instance of Cereal whose name is "Corn Flakes", brand is "Kellogg's", and fiber is 2. To the variable name c2, assign an instance of Cereal whose name is "Honey Nut Cheerios", brand is "General Mills", and fiber is 3. Practice printing both!
Answers
Answered by
0
Answer:
1) class Animal: def __init__(self, arms, legs): self.arms = arms self.legs = legs def limbs(self): return self.arm
Similar questions
Social Sciences,
4 months ago
Computer Science,
4 months ago
Accountancy,
4 months ago
Math,
9 months ago
English,
9 months ago
Science,
1 year ago
Hindi,
1 year ago