Tapeworms are caused by fleas. I went though this with several of my cats a few years back.
The vet can give her medicine for them but if she still has fleas, they will come back. A tapeworm segment looks like a little white or pinkish grain of rice on their bottom. They get them by licking themselves and ingesting the flea eggs that the fleas lay around their bottom. They are one of the few worms that one cat can not give to another. They can however, share fleas. Good luck.