Solving “Who owns the Zebra” programmatically?

Here’s a solution in Python based on constraint-programming: from constraint import AllDifferentConstraint, InSetConstraint, Problem # variables colors = “blue red green white yellow”.split() nationalities = “Norwegian German Dane Swede English”.split() pets = “birds dog cats horse zebra”.split() drinks = “tea coffee milk beer water”.split() cigarettes = “Blend, Prince, Blue Master, Dunhill, Pall Mall”.split(“, “) # … Read more