The general rule is the tank should be 2/3 the length of the tank! So a 3 foot snake should be in a tank that is 24 inches minimum! Of course you would want something bigger to give growing room! A 20 long would be fine for a snake up to almost 4 foot in length.
Correction: I meant to say the tank should be 2/3 the length of the snake!
Example: 3 foot snake(36 inches) needs a 2 foot tank(24 inches)