Follow everybody's advice above me
but also, dont let inflexibility stop u from doing gymnastics!
I wasnt flexible at all when i started a couple months ago (and Im still not), but it gets better over time, and there are plenty of things that you can do that don't involve extreme flexibility when you are starting
That doesnt mean that once you start, you shouldnt work on flexibility, but u dont have to wait until you are really flexible to do start
splits and bridges is probably a good place to start
but make sure to do split stretches before doing full out splits
(especially if your body isn't used to it, you don't want to pull anything)