Efficient List Operations in Python