User Churn Project - Bonus Question?

In the User Churn project with “Codeflix”, the last task is a bonus question:
Screen Shot 2020-10-05 at 2.03.28 PM

Q: “How would you modify this code to support a large number of segments”
A: “Avoid hard coding the segment numbers”

… can anyone explain what this actually means and what the actual code changes would be?

Thanks!

Here is my solution: