# 길이

### 코드

```
{요소} 길이
```

***

### 설명

문자열 또는 리스트의 길이를 가져와요.

문자열 또는 리스트를 변수에 저장하고 변수 이름을 써도 돼요.

***

### 주의사항

* 문자열과 리스트 외의 다른 데이터 종류의 길이는 가져올 수 없어요.

***

### 파이썬 대응 코드

```
len({요소})
```

***

### 예시

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

```
리스트 = [1234, 5678, 1357, 2468]
리스트 길이 보여주기
"안녕 반가워" 길이 보여주기
```

{% endcode %}

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

```
4
6
```

{% endcode %}

***

### 검색 키워드

length


---

# 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/036.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.
