My little guy had tapeworms too.
I asked my vet how he could've gotten them because I don't have any fleas. And my grown dogs don't have any worms. They can pick them up from other dogs feces. He said the eggs hatch every 10 days. They can be in the grass and if you're not careful they can lay eggs in the carpet. The worms usually don't come out until the puppy is sleeping. So, you just have to put your puppy in his/her crate for sleepy time. He was allowed to play with other dogs, but I had to make sure he didn't have any accidents on the rug. I couldn't take him outside to poop either. The other dogs had to kept far away from his feces. So if you have a room with a hard floor put him in there. The vet gave him a pill for tapeworms and he went back for another dose 10 days later. He hasn't had any since then. I found this website it might help.
Tapeworms of Dogs