Skip to content

Comment on Python code to solve xkcd 1313 by Peter Norvig

Comments

I am not sure why Norvig omits president Obama. That said, "[mtg]a" does match him, so at least Munroe tries.

From the article: "I started by finding a page that lists winners and losers of US presidential elections through 2004."

Given that, an interesting variation of the problem is: what's the easiest way to transform an expression to incorporate new data? After the next election, one can toss away the result and re-generate a new one from scratch. But is there an easier way to absorb additional terms, both inclusions and exclusions?

His source page doesn't list Obama, for whatever reason.

http://www.anesi.com/presname.htm

It's just out of date. It says there have been 53 presidential elections since 1789; there have been 56.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.