¿La página no carga? Prueba haciendo clic aquí.
Placeholder

#9601

리스트 3 - 연습문제 9 1s - MB

Problemas

리스트를 생성하여 [3, 5, 1, 10]으로 초기화한 후 리스트 조작함수를 이용하여 다음과 같이 출력하는 프로그램을 작성하시오. (tmp 리스트 초기화 - 소스 참조)


Ejemplo

lst : [3, 5, 1, 10]

len(lst) : 4
lst.append(10) : [3, 5, 1, 10, 10]
lst.pop() : [3, 5, 1, 10]
lst.reverse() : [10, 1, 5, 3]
lst.sort() : [1, 3, 5, 10]
lst.sort(reverse = True) : [10, 5, 3, 1]
lst.remove(1) : [10, 5, 3]
lst.insert(1, 5) : [10, 5, 5, 3]
tmp : [6, 2, 4]
lst.extend(tmp) : [10, 5, 5, 3, 6, 2, 4]
lst.count(5) : 2
lst.index(5) : 1
del(lst[1:3]) : [10, 3, 6, 2, 4]

Fuente

자기주도 파이썬

Debes iniciar sesión para escribir código.