If you're really planning on housing them under you bed it would be better to just make 2 separate enclosures that fit in the space. Snakes aren't like dogs that actually enjoy each other's company.

Is it possible? yes

Is it a good idea? No