# 리스트 (데이터 삭제)

### 코드

```
{리스트이름} {인덱스}번째 값 제거
```

***

### 설명

선언한 리스트에서 단일 데이터를 삭제할 때 사용해요.

데이터를 삭제한 후 삭제된 새로운 리스트를 반환해요. 새로운 리스트를 기존 리스트에 자동으로 저장하지 않아요.

***

### 주의사항

* 삭제 후 새로운 리스트를 저장하지 않아요. 기존 리스트에 저장(덮어쓰기)해야 해요.
* 인덱스는 0부터 시작해요. 아래 코드를 참고하면 돼요.

{% code title="예시 코드1" %}

```
테스트리스트 = [1, 2, 3, 4, 5]
테스트리스트[0] 보여주기
테스트리스트[1] 보여주기
```

{% endcode %}

{% code title="예시 코드1의 출력" %}

```
1
2
```

{% endcode %}

***

### 파이썬 대응 코드

```
del {리스트이름}[인덱스]
```

단, 파이썬의 del은 삭제 후 새로운 리스트를 기존 리스트에 자동으로 저장해요.

***

### 예시

{% code title="예시 코드1" %}

```
리스트 = [1234, 5678, 1357, 2468]

리스트 = 리스트 1번째 값 제거
리스트 보여주기
```

{% endcode %}

{% code title="예시 코드1의 출력" %}

```
[1234, 1357, 2468]
```

{% endcode %}

***

### 검색 키워드

리스트, 집합, 클래스, class


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://codebook.horang.it/readme/035.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
