This confusion got so bad that the United States Supreme Court had to intervene. In 1893, a case called Nix v. Hedden asked: Are tomatoes fruits or vegetables for tax purposes? The court ruled that, for tariff laws, a tomato is a vegetable.
Why? Because people eat them with dinner, not dessert. The justices basically said, “Science is cute, but we’re just trying to tax your salad.” The tomato officially became a legal vegetable, proving that definitions are just suggestions when money is involved.
This means a cucumber is a fruit but gets taxed as a vegetable. A sweet potato is a root (vegetable), but no one is suing over that because sweet potato pie is just too delicious to argue about.
Fruit And Vegetable Difference at Emma Ake blog