11

Pythonでのinオペレータの速度は、イテラブルの長さに比例していますか?

そう、

len(x) #10
if(a in x): #lets say this takes time A
    pass

len(y) #10000
if(a in y): #lets say this takes time B
    pass

A>Bですか?

4

2 に答える 2