Planets are basically just like a bonch of rocks flying around and orbiting the sun. But they can be much more than that if you think about, also in space is there gravity? I will answer qustions like this and many others about planets.
Have your herd about in space there is no gravity? Well there is, infact you are just in free fall mode. Sounds crazy doesn't it? Its actually true. If you drop a brick and a piece of wood at the same time, guess what would happen? They would fall yes, but they would land at the same time. See there is gravity but when you are in free fall you weigh nothing.
Planets are just floating around the sun right, wrong the fly around that big ball of plasma in an orbit. The orbit is sometimes eliptical. In order for these planets to stay orbiting they need a gravitational pull. The sun is keeping these planets in motion for a long time. Also the planets gravity pulls another. Why do you think the moon stays in the same orbit? The Earths gravitational pull is keeping the moon moving. Also the Moon's gravitational pull makes waves on planet Eearth.
In conclustion, Gravity is out in space. Make sure you use that gravity right and not wrong.