mercredi 14 février 2018

search in entere array for value within for loop Python

I'm PLSQL programming and now I'm learning Python. I want to code a simple for loop and print a value if the condition is true. But How can I search a entire array? Do you have any idea? Thanks

v_names ['Gustavo', 'Tim', 'Matt', 'Bjorn', 'Lars']

for names in v_names:
    if names[x] == 'Gustavo': #wrong code line, I need your help here
        print ('You have a great name!') 

Aucun commentaire:

Enregistrer un commentaire