프로그래밍 지식/Python

[Python] 문자열, 리스트 변환

게임이 더 좋아 2020. 7. 8. 12:39
반응형
728x170

https://www.hackerrank.com/challenges/python-mutations/problem?h_r=next-challenge&h_v=zen&h_r=next-challenge&h_v=zen&h_r=next-challenge&h_v=zen

 

Mutations | HackerRank

Understand immutable vs mutable by making changes to a given string.

www.hackerrank.com

이 문제를 기반으로 설명한다

 

 

 

 


mutable, immutable 둘 구분할 수 있어야 한다.

 

우선 str은 immutable 이고 list 는 mutable이다. 즉 str을 수정하고 싶다면 list로 바꾸어서 수정해야 한다.

 

위는 그 과정이다.

 

반응형
그리드형