Organizing Python Codes Using Functions