I believe the former prime minister of Singapore studied Math, CS and worked as a programmer for some time, here is more discussion and some other examples: <a href="https://news.ycombinator.com/item?id=9419035">https://news.ycombinator.com/item?id=9419035</a>
Will Hurd is one I can think of off the top of my head: <a href="https://en.m.wikipedia.org/wiki/Will_Hurd" rel="nofollow noreferrer">https://en.m.wikipedia.org/wiki/Will_Hurd</a>
Not exactly a programmer, but a professor of computer science.
He was the mayor of the city where I lived<p><a href="https://en.wikipedia.org/wiki/Furio_Honsell" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Furio_Honsell</a>