Python Versions of Societies code