Computers/Language python 23

Mutation / Aliasing

string에서는 한글자의 값을 바꾸는게 불가능하지만List에선 가능. example. p = ['H','e','l','l','o',] p[0] = 'Y' print p>>>['Y','e','l','l','o',] s = 'Hello's[0] = 'Y' // error ---------------------------------------------------------------------------------------------------------- >>> p = ['H','e','l','l','o']>>> q = p>>> print p,q['H', 'e', 'l', 'l', 'o'] ['H', 'e', 'l', 'l', 'o']>>> p[0] = 'Y'>>> print p['Y', 'e', 'l..