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 8142147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:43:15+00:00 2026-06-06T12:43:15+00:00

Hey this might be a simple question, but i have been stumped on it

  • 0

Hey this might be a simple question, but i have been stumped on it for awhile =/

I have a string A:

A = ('A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5')

And a corresponding list B, that displays the exact position of each value inside the inner parenthesis of the string A:

B = [12 13 14 15 16 17 18 19 20 21 22 23]

I want to make a new list, list C that prints the values inside the parenthesis of String A, which is defined by the numbers in list B.

Thanks for the help!

Edit:
My goal is to create a list that just prints what is inside the inner parenthesis, something like this:

C = ('C:0.3,D:0.4')

I will then split at the comma, and input the corresponding 2 strings into another function i have defined, but right now, i just need list C

  • 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-06T12:43:16+00:00Added an answer on June 6, 2026 at 12:43 pm
    >>> A = ('A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5')
    >>> B = [12 ,13, 14 ,15, 16, 17, 18, 19 ,20 ,21, 22, 23]
    >>> C=[A[x] for x in B]
    >>> C
    ['(', 'C', ':', '0', '.', '3', ',', 'D', ':', '0', '.', '4']
    

    EDIT:

    >>> A = ('A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5')
    >>> C=A[A.find('('):A.find(')')+1]
    >>> C
    '(C:0.3,D:0.4)'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, this question might be a little weird worded but I was looking
Hey this is probably a dumb question but i can't seem to find a
Hey I have this code but it doesn't work because it is expecting a
hey guys, this might be really stupid, but hopefully someone can help. I'm trying
Hey guys - I know this is not a strictly programming question but I'm
Seems that it may not be possible, but hey I might as well ask,
Hey all. I'll try to make this brief and simple. :) I have 40
Hey all, I think this might be a bug, but it's killing me. I
Hey, this question might sound totally idiotic so I am sorry. I am a
Hey guys, So I have this report that I am grouping into different age

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.