Fixed #23968 -- Replace list comprehension with generator comprehension when possible

or use dict comprehension:

```py
{color_names[x]: '3%s' % x for x in range(8)}
```