강의

멘토링

커뮤니티

Inflearn Community Q&A

sshyeok15013's profile image
sshyeok15013

asked

Free Python Tutorial (Basic) - Become a Developer in 6 Hours

set에서 pop을 하면 왜 계속 첫번째 값만 빠져나오나요??

Written on

·

484

0

유투브로 보다가 질문하게 되었습니다.

set집합에서는 순서가 없어서 나올 때 순서없이 아무렇게나 나오는 것으로 이해해서  퀴즈#4를 하면서 pop을 써볼까 생각했습니다.

그런데 몇 번을 반복해도 맨앞의 값만 빠져나와서 설명해주셨으면 합니다.

box = range(1,101)
box = set(box)
print(type(box))
print(box.pop())
python

Answer 1

0

nadocoding님의 프로필 이미지
nadocoding
Instructor

아래 링크의 설명으로 대신 답변드립니다 ^^

https://dojang.io/mod/forum/discuss.php?d=797

sshyeok15013's profile image
sshyeok15013

asked

Ask a question