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