Python How To Make This Script More Efficient Stack Overflow

Python How To Make This Script More Efficient Stack Overflow