반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Java
- array
- list
- numpy
- string
- Mac
- PySpark
- hive
- Apache
- Redshift
- math
- SQL
- GIT
- Google Spreadsheet
- 파이썬
- Tkinter
- google apps script
- Kotlin
- Github
- Google Excel
- gas
- PostgreSQL
- matplotlib
- c#
- dataframe
- django
- Excel
- Python
- PANDAS
Archives
- Today
- Total
목록TAKE (1)
달나라 노트
Kotlin - take (collecion에서 원하는 개수의 요소들만 얻기)
take 함수는 collection에서 원하는 개수의 요소만 골라 새로운 collection을 만듭니다. fun main() { var fruits = listOf("Apple", "Strawberry", "Tomato", "Watermelon", "Grape") fruits = fruits.take(3) println(fruits) } -- Result [Apple, Strawberry, Tomato] 위 예시를 보면 fruits list에 take(3)이라는 함수를 적용하고 있습니다. 그 결과는 fruits list의 가장 앞의 3개 요소만 있는 list가 만들어졌음을 알 수 있죠.
Kotlin
2021. 4. 13. 01:51