[PYTHON][HELP NEEDED!]Words in a string / list & using enumerate
Go to solution
Solved by Nineshadow,
1 minute ago, CandleJakk said:Yes, that's what I was looking for, sorry for not specifying.
This is what you're looking for?
def findAll(str,sub):
str=str.split()
v = [i+1 for i, x in enumerate(str) if x==sub]
return v

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now