Organizing Python Codes Using Functions And Mapping