728x90 반응형 SMALL pythonlist1 Python - 자료구조 리스트 - 대괄호 [] 를 이용해서 표현한다. - frutslist = ['apple', 'banana', 'orange'] for f in frutslist: print(f) frutslist.append('mango') frutslist.sort() del frutslist[0] 튜플 - 리스트와 비슷하지만 수정이 불가능하여 주로 문자열과 같이 비정적인 객체들을 담을 때 사용한다. - 리스트 안의 리스트는 리스트의 성질을 잃지 않는다. 파이썬에서 이들은 단지 다른 객체 안에 저장된 객체일 뿐이다. zoo = ('python', 'elephant', 'penguin') new_zoo = 'monkey', 'camel', zoo print('num of cages in the new zoo is', le.. 2018. 8. 30. 이전 1 다음 728x90 반응형 LIST