value = ["python:guru-age20",
"is_it_possible_time100:goodTime99",
"hmm_hope_no_onecanansswer"]
How to get a particular string from this list of strings? I need to find goodTime99 from the li[1] string and its exact postion
if value.find("goodTime99") != -1: I know will work if I give the entire string is_it_possible_time100:goodTime99.
Otherwise how to exact the position by searching goodTime99 instead of searching for is_it_possible_time100:goodTime99? value.index("goodTime99") is giving an error.
I am not looking for whole string to search, value.index("is_it_possible_time100:goodTime99") is fine but I don’t want this. Anyway to do this?
If you only want to check for the presence of
"goodTime99"in any string in the list, you could try:If you need the exact position:
or: