Get value from a list

1

I need to get the second value from this list

['connections-wfs', 'Prueba', 'url=https://test.com/ows/wfs\n']

The data is not always the same but if you always have the same number of values, in this example it would be

  

'Test'

    
asked by Sebastian 15.08.2018 в 13:24
source

2 answers

0

To get an item in a list you only need the index (using base 0):

lista = ['connections-wfs', 'Prueba', 'url=https://test.com/ows/wfs\n']

n = lista[1] # Prueba
    
answered by 15.08.2018 / 13:37
source
2

Assuming your list is called list1.

lista1[1]

In the lists, you can access the determined positions, this is list [0] you will get the first value from the list, list [1] the second, list [n] will take you out the value in position n + 1 of the list.

    
answered by 15.08.2018 в 13:37