I have a list, whose indices are mostly integer numbers, but occasionally, there are some 'X' entries. I need all of the entries to perform list operations with this list and another list. How can I replace the 'X' entries which are strings with integers zeroes, while keeping the lists the same length.
I've tried using if statements to replace the entry if it is an 'X', but that just gave me a type error.
Example: changing
['X', 'X', 52, 39, 81, 12, 'X', 62, 94]
to
[0, 0, 52, 39, 81, 12, 0, 62, 94]
in which all entries in the second list are int.