+ 2

How to solve 51 code project?(Python)

I can't know that. This is my code. What is arror? class Juice: def __init__(self, name, capacity): self.name = name self.capacity = capacity def __str__(self): return (self.name + ' ('+str(self.capacity)+'L)') def __add__(Orange, Apple): return (Orange + Apple a = Juice('Orange', 1.5) b = Juice('Apple', 2.0) result = a + b print(result)

27th Feb 2022, 1:05 AM
Chris
1 Answer