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
Get step-by-step solutions from verified subject matter experts
