DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
how to get all index of a char of a string in python
word = 'Hello' to_find = 'l' # in one line print([i for i, x in enumerate(word) if x == to_find])
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#index
#char
#string
#python
ADD COMMENT
Topic
COMMENT
Name
5+7 =
Submit