Why is my sum variable text white? [solved]

I have a question about this line of code: sum = lst[int(len(lst)/2)] + lst[int(len(lst)/2) - 1]

Why is word “sum” white? Normally when I assign variables some sort of value, the name of the variable is red. Is this a special function of some sort?

The editor is telling you that the name, sum is already taken. It’s not a safe practice to use the names common to the standard library (or any modules).

>>> sum([1,2,3,4,5,6,7,8,9])
45
>>>

We see that it is a built in function for adding up a list of numbers.

Best advice, when you see white, change the name or add a letter or two.

my_sum = ...