# 리스트

### 코드

```
{리스트 이름} = [{저장할 데이터1}, {저장할 데이터2}, {저장할 데이터3}, ...]
```

***

### 설명

**리스트(또는  배열)**&#xB294; 여러 데이터를 하나로 묶어놓은 변수예요.

리스트는 대괄호 안에 데이터를 넣으면 되고, 쉼표를 통해 데이터를 구분해요.

한 리스트 안에는 여러 데이터 종류가 담길 수 있고, 또 다른 리스트(ex. 2차원 리스트, 3차원 리스트 등)을 쓸 수도 있어요.

***

### 주의사항

* 리스트 이름은 띄어쓸 수 없어요.
* 리스트 이름은 숫자로 시작할 수 없어요.
* 리스트 이름에는 언더바(\_)를 제외한 특수문자를 사용할 수 없어요.
* 리스트 이름으로 예약어(보여주기, 입력받기, 반복 등)를 사용할 수 없어요.

***

### 파이썬 대응 코드

```
{리스트 이름} = [{저장할 데이터1}, {저장할 데이터2}, {저장할 데이터3}, ...]
```

***

### 예시

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

```
리스트1 = ["안녕1", "안녕2", "안녕3"]
리스트2 = [1234, 5678, 1357, 2468]
리스트3 = ["안녕1", 1234, ["반가워, "친구들"]]

리스트1 보여주기  # [리스트를 출력하는 것으로, 리스트과 무관합니다]
리스트2 보여주기  # [리스트를 출력하는 것으로, 리스트과 무관합니다]
리스트3 보여주기  # [리스트를 출력하는 것으로, 리스트과 무관합니다]
```

{% endcode %}

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

```
["안녕1", "안녕2", "안녕3"]
[1234, 5678, 1357, 2468]
["안녕1", 1234, ["반가워, "친구들"]]
```

{% 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/003.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.
