게시글
질문&답변
2024.04.25
10:26 popitem() 질문입니다
안녕하세요. 좋은 질문 감사합니다. 현재 사용하시는 파이썬 버전에서는 마지막 값이 제거 되는 것이 맞습니다. 과거에는 공식 레퍼런스를 보시면 버전에 따라서 랜덤 아이템 또는 마지막 아이템이 제거 되는 함수 입니다. 그래서 버전에 따라 random 함수하고 같이 사용 하는 경우가 많습니다. Python Dictionary popitem () Method The popitem () method removes the item that was last inserted into the dictionary. In versions before 3.7 , the popitem () method removes a random item. The removed item is the return value of the popitem () method, as a tuple, see example below. popitem () Remove and return a (key, value) pair from the dictionary. Pairs are returned in LIFO order. popitem() is useful to destructively iterate over a dictionary, as often used in set algorithms. If the dictionary is empty, calling popitem() raises a KeyError . Changed in version 3.7: LIFO order is now guaranteed. In prior versions, popitem() would return an arbitrary key/value pair. 버전별로 동작이 상이 하기 때문에 외국 포럼에서도 질문이 자주 등장합니다. https://stackoverflow.com/questions/4809044/removing-items-randomly-from-a-dictionary 감사합니다.
- 0
- 1
- 32
질문&답변
2024.04.24
강의자료 부탁드립니다.
네 알겠습니다.
- 0
- 1
- 24
질문&답변
2024.04.18
안녕하세요 강의자료 부탁드립니다!
네 감사합니다.
- 0
- 1
- 39
질문&답변
2024.04.18
12:47 index 함수 질문입니다.
네 맞습니다. 인덱스 번호를 가져오는 함수입니다. 확인 후 수정해놓도록 하겠습니다. https://m.blog.naver.com/sw4r/221976911807
- 0
- 1
- 37
질문&답변
2024.04.17
강의자료 부탁드립니다
네네 감사합니다.
- 0
- 1
- 45
질문&답변
2024.04.16
안녕하세요 강의 자료 부탁드립니다.
네 감사합니다.
- 0
- 1
- 52
질문&답변
2024.04.16
안녕하세요 강의자료 부탁드립니다
네 감사합니다.
- 0
- 1
- 35
질문&답변
2024.04.15
안녕하세요. 강의자료 부탁 드립니다.
네 감사합니다.
- 0
- 1
- 56
질문&답변
2024.04.15
질문
안녕하세요. 맥을 사용하시나봐요! https://www.lainyzine.com/ko/article/how-to-install-visual-studio-code-on-macos/#table-of-contents 위 링크에서 중간에 보면 터미널에서 맥 실행하는 방법에 대해서 한 번 읽어보시고 Path에 등록을 시켜주셔야 사용하실 수 있습니다. 링크를 한 번 확인 부탁드립니다.
- 0
- 1
- 45
질문&답변
2024.04.11
강의자료 부탁드립니다.
네 알겠습니당~
- 0
- 1
- 56