I have a piece of code:
binCounts = []
for i in range(len(bins)):
binCounts.append(0)
where bins
is an array that looks something like this:
['chrY', '28626328', '3064930174', '28718777', '92449', '49911'], ['chrY', '28718777', '3065022623', '28797881', '79104', '49911'], ['chrY', '28797881', '3065101727', '59373566', '30575685', '49912']]
When I run just range(len(bins))
in Python's interactive mode, I get:
[0, 1, 2]
but when I test the whole piece of code, I'm getting
[0,0,0]
I believe I should be getting
[0, 1, 2, 0]
This is resulting in a Division by Zero error later on down the line. Why is this happening? How can I fix it? I appreciate your guidance!