Computers/Language python

String vs. List vs. Dictionary

emzei 2012. 3. 14. 19:46

String 'hello'

- sequence of character

- immutable

error : s[i] = 'x'

- s[i] : i th character in s



List : ['alpha', 23]

- list of elements

- mutable

- p[i] : i th element of p



Dictionary : { 'hydrogen':1 , 'helium' : 23 }

- set of <key, value> pairs

- mutable

- d[k] : 

k : key

value associated with k in d 

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

변수 초기화  (0) 2012.03.14
Properties of Dictionary  (0) 2012.03.14
hash function  (0) 2012.03.14
시간 측정  (0) 2012.03.14
try / except  (0) 2012.03.14