Question: I need help creating a function called candy_info that returns a 'Candy' object created using a constructor. Here is some info: Question and Solution requirements:

I need help creating a function called candy_info that returns a 'Candy' object created using a constructor.

Here is some info:

Question and Solution requirements:

I need help creating a function called candy_info that returns a 'Candy'

Class Code:

object created using a constructor. Here is some info: Question and Solution

Test Code:

requirements: Class Code: Test Code: Thank you for your help and time!

Thank you for your help and time!

Problem Overview Your task in this homework assignment is to write a function returns the Candy object. Solution Specifications Your solution to this problem must meet the following criteria. 1. You must define a function candy_info in the file candy_function .py that takes a three parameters. - a string for the name of the candy - an int for the number of grams of sugar - a float for the price of the candy 2. The function must return the Candy object. class Candy: def _init__ (self, name, sugar, price): self.name=nameself.sugar=sugarself.price=price import candy_function. \# test the function my_candy = candy function. candy_info("SUGAR DADDY MILK CARAMEL POPS", 24, 10.45) print(my_candy. name) print(my_candy.sugar) print(my_candy.price)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!