반응형
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 |
Tags
- GIT
- c#
- Mac
- dataframe
- Github
- google apps script
- Google Excel
- Java
- Apache
- Google Spreadsheet
- array
- 파이썬
- django
- numpy
- Python
- Kotlin
- matplotlib
- Tkinter
- list
- Redshift
- Excel
- PostgreSQL
- string
- PANDAS
- PySpark
- SQL
- gas
- hive
- math
Archives
- Today
- Total
목록shuffled (1)
달나라 노트
Kotlin - shuffled (collecion에 있는 요소들을 랜덤하게 재배열하기)
shuffled 함수는 collection의 요소들을 랜덤하게 재배열합니다. fun main() { var fruits = listOf("Apple", "Strawberry", "Tomato", "Watermelon", "Grape") fruits = fruits.shuffled() println(fruits) } -- Result [Strawberry, Tomato, Apple, Watermelon, Grape] fruits라는 list를 생성하고 shuffled를 적용시켜보았습니다. 그 결과를 보면 fruits의 요소들이 랜덤하게 재정렬된 것을 볼 수 있습니다. (따라서 이 결과는 위 코드를 실행할 때 마다 달라질 것입니다.)
Kotlin
2021. 4. 13. 01:45