Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to extract values from complex list forms

I have a list
result_list=[‘hello(1,2)’,’bye(3,4)’]

How to get a string

\>>hello

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

\>>1

\>>2

>Solution :

i did not understand your question but i am trying to help you

i think you want the result be like this

1- the word that contains numbers

2- the numbers

i think this code will help:

for i in result_list:
    print(i.split("(")[0])
    print(i.split("(")[-1].split(")")[0].split(",")[0])
    print(i.split("(")[-1].split(")")[0].split(",")[1])
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading