Since “vegetable” is not a botanical term, there is no contradiction in referring to a plant part as a fruit while also being considered a vegetable . Given this general rule of thumb, vegetables can also include leaves (lettuce), stems (asparagus), roots (carrots), flowers (broccoli), bulbs (garlic), seeds (peas and beans) and botanical fruits such as cucumbers, squash, pumpkins, and capsicums (bell peppers). Botanically, fruits are reproductive organs (ripened ovaries containing one or many seeds), while vegetables are vegetative organs which sustain the plant.
The question "is it a fruit, or is it a vegetable?" has even found its way into the United States Supreme Court, which ruled unanimously in Nix v. Hedden, 1893, that a tomato is a vegetable for the purposes of 1883 Tariff Act, although botanically, a tomato is a fruit.