#python #anaconda #jupyter-notebook #visual-code #html #css #javascript #http

제목swcon104-01에서 1번 문제 질문이요.2019-10-21 22:06
작성자

a= [1, 2, 1, 8, 9, 4, 2, 5, 1, 3]
b= 3

for i in a:
    if i >= b:
        a.remove(i)      
       

print(a)

[1, 2, 1, 8, 9, 4, 2, 5, 1, 3]
[1, 2, 1, 9, 2, 1]


이렇게 실행해보았는데 결과에 자꾸 9가 포함됩니다...
왜 이런건가요?
댓글