Quite often is the answer. Botanically or technically speaking ‘a fruit is a seed bearing structure that develops from the ovary of a flowering plant whilst a vegetable is the other parts of the plant, leaves, stems, roots’.
What we commonly call a vegetable, a tomato, a zucchini, a cucumber are actually fruits, botanically speaking, whilst celery, beetroot, carrot, lettuce, etc. are vegetables.
If it has seeds, it’s a fruit, if it doesn’t, it’s a vegetable!