This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hey everyone, I'm very new to Kotlin and I'm having a very difficult time figuring this out. So I have a list of tuples as such
``` val item1 = Pair(UUID.randomUUID(), "s1") val item2 = Pair(UUID.randomUUID(), "s2") val item3 = Pair(UUID.randomUUID(), "s3") val item4 = Pair(UUID.randomUUID(), "s4")
val tupleList = listOf(item1, item2, item3, item4)
val onlyTheUuids = ? val onlyTheStrings = ? ```
In Python I can do the following, but I'm having a hard time finding a Kotling equivalent ```
inpt = [(uuid.uuid1(), u's1'), (uuid.uuid1(), u's2'), (uuid.uuid1(), u's3')]
zipped = list(zip(*inpt)) print(zipped) [(UUID('9e7ff324-aa3a-11ed-96e7-925e62733aaa'), UUID('9e7ff770-aa3a-11ed-96e7-925e62733aaa'), UUID('9e7ff7b6-aa3a-11ed-96e7-925e62733aaa')), ('s1', 's2', 's3')]
noticed how the uuids and the strings are separated
```
Perhaps I'm lacking the proper terminology to properly google this, but not much is showing up.
Subreddit
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Kotlin/comm...