Hi, and welcome. As already said, a 20 long will be easier to give a good temp gradiet,(plus the snake will enjoy the room) but I have gone a few routes with smaller tanks- either an undertank heater on one end (they are better off with a thermostat- some of them get really hot), or flexwatt heat tape (has to be thermostatically controlled) or by pointing a 40 watt heat lamp at the outside of one end of the tank. I do this on 5 gallon tanks for small desert snakes like shovelnose and ground snakes, it gives me a temp gradient of over 100 deg. f. down to room temp in a 16" long tank.
If using a heat lamp over a 10 g, be very careful to check temps.
Ge makes a 30 watt flood bulb in an r20 size that throws a pretty tight heat pattern(walmart has them). You could try one of them over one end of a 10 gal and see what temps you get.
Ultimately, you will be better off with a 20L though.