Anthony Quinn, 41, opened an animal cage at a Dobbies Garden Centre before slipping the snake into his sweater.
Questioned by suspicious staff who had seen him fiddling with the locks, he told them he had just been seeing how the catches worked - before he walked out and drove off.
Six years beforehand the father-of-two had been fined £200 for keeping the alligator in his 15th floor flat in Edinburgh and driving it around in his boot.
Stirling Sheriff Court heard that Quinn had been out shopping for Christmas presents with pal Scott Cruickshank, 38, when he snaffled the snake, a juvenile Royal Python.
Kevin Corrins, prosecuting, said the theft happened at around 4.30 pm in the aquatic section of the centre, outside Stirling, which has a number of caged reptiles that can be bought by members of the public.
The depute fiscal said: “A shopper became aware of the two accused both being within the store.
“They heard a crack and saw Quinn open one of the cages and put something from within the cage into the front pocket of his top.
“The shopper advised members of staff what he had witnessed. A member of staff then approached Quinn and asked what he was doing. He said that he ‘wanted to see how the cages opened’.
“He then left the shop, got into a car and drove off.”
The court heard that Cruickshank, 38, was then accused of being involved in some way, and began “making a scene”.
Mr Corrins said: “He said he was being discriminated against. It was at this point he began to shout and swear, and two members of staff both asked him to leave.
“When staff checked the section they discovered the Royal Python, worth £75, was missing from its cage.”
He said it took police almost six months to track down Quinn.
Mr Corrins said: “Quinn was interviewed and replied to one question that his lawyer had told him to say no comment.
“But he said ‘I don’t have any snake. It wasn’t for me. Scott’s friend has the snake’.”
The court heard the snake has still not been recovered.
Quinn, of Nisbet Court, Edinburgh admitted stealing the snake and forcing open a lockfast cage.
Cruickshank, of Calder Crescent, Edinburgh, admitted breach of the peace.
The incident happened on 19 December, 2010,
Jim Stephenson, defending for Quinn, said his client had a “serious alcohol problem”.
Before sentencing, Sheriff Wyllie Robertson asked: “How dangerous is this snake? It’s not within my judicial knowledge but I certainly wouldn’t want one in my front pocket.”
He left the bench for 20 minutes while the Crown looked into the species’ reputation.
After the adjournment, Mr Corrins told him it was “quite shy”, but might have grown.
The depute fiscal said: “It was about half a metre long, my Lord, and quite a thick snake, according to the stock manager at Dobbies.
“They said it’s not a venomous snake. It’s quite shy and easy to handle, but by now it could be over three foot long.”
Sheriff Robertson jailed Quinn for five months and fined Cruickshank £450 for his behaviour.
He told Quinn, who showed no emotion: “You have a bad record going back some time and have pleaded guilty to a serious charge. I see custody as the only option in this case.”
Quinn avoided jail at Edinburgh Sheriff Court in 2005 for trying to sell the four-foot long alligator.
He said he bought it on the Internet for £250 and kept it in a fish tank, before it grew so large he had to move it to the bath and eventually he had get rid of it.
He was snared by SSPCA officers, who posed as buyers after they saw his advert in a trade mag.
Sheriff Kenneth MacIver had told him he was lucky to still have both arms, adding: “If it was not for the utter stupidity of your actions then I would have to think what happened was more sinister.”