Best Coding Practices For Python Loop