Question: Consider the code given and rectify NameError. # Create the Fruit class class Fruit: def __init__(self, name, color): self.name = name self.color = color #

Consider the code given and rectify NameError. # Create the Fruit class class Fruit: def __init__(self, name, color): self.name = name self.color = color # Create the Vegetable class class Vegetable: def __init__(self, name, price): self.name = veg_name self.price = price F = Fruit("Apple","Red") V = Vegetable("Tomato" , "$10") print(F.name) print(F.color) print(V.veg_name) print(V.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