From a botanical perspective, a fruit is a structure that develops from parts of the flower and holds seeds, so squash, cucumbers and green beans are indeed fruits (individual beans, like kidney or lima beans, are seeds rather than fruit). Fruits don’t have to be fleshy, though—seed-holding structures like nuts, acorns and dry capsules are also considered botanical fruits. The term “vegetable” doesn’t have a precise botanical meaning like “fruit” does, but vegetables are often defined as all of the nonfruit plant parts that we consider edible. This includes leaves (lettuce and kale), flower buds and stalks (cauliflower and broccoli), roots (carrots and beets), bulbs (onions and garlic) and tubers (potatoes).
“Nuts are considered fruits.”
In the produce section at the grocery store or in the kitchen, though, what we think of as a fruit doesn’t necessarily match the botanical definition. In culinary terms, fruits usually are fleshy, juicy and often sweet, and used for desserts. While squash, cucumbers, peppers, eggplants and avocados are all botanically fruits (because they contain one or more seeds), we think of them as vegetables because they are typically used in savory dishes. And then there’s the tomato. A famous Supreme Court case involving food import tariffs back in 1893 ended with the decision that, while technically a fruit, the tomato was legally considered a vegetable because of how it was used in cooking.