Completion of Python Class and Codes