Yes that's true they do.
A sample of gas will change its shape and size, to take on the exact shape and size of whatever container you put it in.