Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8709033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:16:07+00:00 2026-06-13T04:16:07+00:00

value = [python:guru-age20, is_it_possible_time100:goodTime99, hmm_hope_no_onecanansswer] How to get a particular string from this list

  • 0
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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:16:08+00:00Added an answer on June 13, 2026 at 4:16 am

    If you only want to check for the presence of "goodTime99" in any string in the list, you could try:

    value = ["python:guru-age20", "is_it_possible_time100:goodTime99","hmm_hope_no_onecanansswer"]
    if any("goodTime99" in s for s in value):
        # found it
    

    If you need the exact position:

    >>> next((i for i, s in enumerate(value) if "goodTime991" in s), -1)
    1
    

    or:

    def find_first_substring(lst, substring):
        return next((i for i, s in enumerate(lst) if substring in s), -1)
    
    >>> find_first_substring(value, "goodTime99")
    1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Python I can use get method to get value from an dictionary without
Please I need help getting the exact md5 value of this python script in
I need to store a list of 1 million key-value pairs in python. The
Is there anyway to discover the python value of a PyObject* from a corefile
Searching a Python dictionary based on the value first, to get a key output
I'm reading a date from an Excel cell in Python (using .Value on the
I'm trying to convert characters in string into ascii value in Python Like ord('a[i]')
I need to access the elapsed time since startup in nanoseconds from a Python
how can i rename key value in python? i have this code : t
How do I initialise a list with 10 times a default value in Python?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.