Aug 18, 2021 11:43 AM
(This post was last modified: Aug 18, 2021 01:08 PM by simmer.)
How can I fetch the last position of an item in a list?
index() references the first position…
index() references the first position…
|
Python
Last position of an object in list |
|
Aug 18, 2021 11:43 AM
(This post was last modified: Aug 18, 2021 01:08 PM by simmer.)
How can I fetch the last position of an item in a list?
index() references the first position…
Aug 19, 2021 02:28 AM
(This post was last modified: Aug 19, 2021 02:29 AM by SIM-888979.)
Code len(yourList) - 1Pretty sure this works. (Aug 19, 2021 02:23 AM)vorticalbox Wrote: This returns the last item, not the index.
lel
(Aug 19, 2021 02:28 AM)SIM-888979 Wrote: very good point I misread the OP ¸„»°'´¸„»°'´Vorticalbox `'°«„¸`'°«„¸ `'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est ¸„»°'´`'°«„¸`'°«„¸¸„»°'´ |
|
|
| Possibly Related Threads... | |||
| Thread / Author | Replies | Views | Last Post |
| [Release] by kunsDec 29, 2023 03:29 PM | 0 | 147 |
Dec 29, 2023 03:29 PM Last Post: kuns |
| [Release] by kunsDec 29, 2023 03:28 PM | 0 | 135 |
Dec 29, 2023 03:28 PM Last Post: kuns |
| [Python] by simmerDec 3, 2021 06:39 AM | 4 | 177 |
Dec 3, 2021 06:39 AM Last Post: simmer |