Question: Write a class called Widget with an __init__ method. Each Widget should have an instance variable called name and an instance variable called cost that

Write a class called Widget with an __init__ method. Each Widget should have an instance variable called name and an instance variable called cost that represents a cost in dollars; those values are passed in when a Widget is created. Also write a method in class Widget called is_cheap, which returns True if the cost is less than $10, and False otherwise.

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!