If natural lighting is not available or if the enclosure is not in a location that receives direct sunlight, artificial lighting should be used.
The primary reason for providing lighting to your ball python is for heating and to help them maintain a proper day and night cycle, so they don’t stress out and they remain mentally fit.