Find the index of a specific item in the Python list

Asked 2 years ago, Updated 2 years ago, 94 views

["hello"",python"",world",!"]Item in How can I find the index (2) of "world"?

list python

2022-09-22 22:36

1 Answers

You can write it like this. ["hello","python","world","!"].index("world")

See Mutable Sequence Types for other sequence type methods


2022-09-22 22:36

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.