Python-一个错误

Python-一个错误,python,Python,我得到的错误是: tA=[] tC=[] tG=[] tT=[] i=0 #this is the specific part of my script, A, T, G % C are 4 lists that consists from 10 indexes, each of which is a different number for i in range(11): A1=A[i]*3/100 C1=C[i]*3/100 G1=G[i]*3/100 T

我得到的错误是:

tA=[]
tC=[]
tG=[]
tT=[]
i=0

#this is the specific part of my script, A, T, G % C are 4 lists that consists from 10 indexes, each of which is a different number

for i in range(11):
    A1=A[i]*3/100
    C1=C[i]*3/100
    G1=G[i]*3/100
    T1=T[i]*3/100

    tA.append(A1)
    tC.append(C1)
    tG.append(G1)
    tT.append(T1)

    i=i+1
对于这一行:

list index out of range
我知道我为什么得到它,我只是不知道如何解决这个问题。
帮助?

因为
范围(11)
有11个元素-包括0到10个。。。只需使用
range(10)
,它将匹配列表的索引(0-9)。

Python索引是基于0的

如果A有10项,则A[10]崩溃。使用

A1=A[i]*3/100

作为范围的参数,以确保不超过其索引。

您说您的列表包含10个条目,但您循环了11个条目。
range(11)
调用返回一个列表,其中包含从
0
10
的值,换句话说是11个值

请记住,在Python中,所有索引都是从零开始的,即第一个索引是零,最后一个是(长度-1)

更改为
范围(10)

min(len(A), len(B), len(C), len(T))