clear() 메서드는 리스트에서 모든 요소를 제거합니다.
매개변수는 없습니다.
fruits = ["apple", "banana", "cherry"] fruits.clear() print(fruits)
결과
[]
17 파이썬에서 The driver cannot recognize the specified command parameter 에러 해결방법
12 python에서 에러가 발생한 후에도 코드 실행을 계속할 수 있는 방법
14 파이썬에서 파일 다운로드 하는 방법
11 파이썬에서 string, datetime으로 정렬하기
15 에러가 있는데 Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFoundError: No module named 'encodings'
© 2022 pinfo. All rights reserved.