Computers/Language python

index

emzei 2012. 3. 14. 17:14

<list>.index(<value>)

value가 list내에 존재한다면 그 첫번째 index를 리턴

존재하지 않을 경우 - error 생성


<value> in <list>

value가 list내에 존재한다면 True 리턴

존재하지 않을 경우 - False 리턴


<value> not in <list> 

<=> not <value> in <list>

'Computers > Language python' 카테고리의 다른 글

try / except  (0) 2012.03.14
list: pop  (0) 2012.03.14
power operation  (0) 2012.03.14
List Operation  (0) 2012.03.14
Mutation / Aliasing  (0) 2012.03.14