Anonymous user
Stable marriage problem: Difference between revisions
→{{header|Python}}: Removed debug code.
(New task and Python solution.) |
(→{{header|Python}}: Removed debug code.) |
||
Line 36:
=={{header|Python}}==
<lang python>import random, copy
from collections import defaultdict
guys = 'abe bob col dan ed fred gav hal ian jon'.strip().split()
gals = 'abi bea cath dee eve fay gay hope ivy jan'.strip().split()
guyprefers = {'abe': ['abi', 'eve', 'cath', 'ivy', 'jan', 'dee', 'fay', 'bea', 'hope', 'gay'],
|