반응형
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 |
Tags
- Apache
- dataframe
- Kotlin
- gas
- math
- PostgreSQL
- PANDAS
- 파이썬
- string
- Google Excel
- SQL
- google apps script
- PySpark
- Tkinter
- Google Spreadsheet
- Mac
- django
- matplotlib
- hive
- numpy
- list
- GIT
- Excel
- Redshift
- Github
- c#
- array
- Python
- Java
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