If you want to compare an element of the array you can do it by indicating its index, remember that it starts with 0, for example, to compare the first element of the array:
saludo = ['bien', 'genial']
#primer elemento del array, indice 0.
if saludo[0] == 'bien':
print('Me alegro')
else:
print('Que bueno que estes genial')
To make a comparison with all the elements of the array, obtain the elements of the array by means of a for
and make the comparison, remember that the indentation is important:
saludo = ['bien', 'genial']
for i in range(len(saludo)):
if saludo[i] == 'bien':
print('Me alegro')
else:
print('Que bueno que estes genial')
you would have as output:
Me alegro
Que bueno que estes genial
here a online demo .