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 get value inside the array result in python?

I have below code:

test1 = []          
test11=yield context.task_all(result1)
test1.append(test11[0])
test1[0]

test2 = yield context.task_all(result2)

test11 has below value:

['success']
special variables
function variables
0: 'success'
len(): 1

I wanna get only ‘success‘ from the variable test11. How can I get the value?
here is the data which get in variable:
enter image description here

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

>Solution :

To get the string ‘success’ from the variable test11, you can use the following code:

successString = test11[0]

This will retrieve the first element in the test11 array, which should be the string ‘success’. You can then use this variable in your code as needed.

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