The short answer after the edit:
To access the name, it is important to realize that persons[0]
is also a list. So you need to access the first element of this list in order to get the name:
if persons[0][0] == 'Peter':
# do something
It seems to me that your list persons
has always a name and an age that belong together. For such type of structure a list might not be ideal and I would recommend using a dictionary.
To start to work with dictionaries you need to convert your list:
# cerate a dictionary
persons_dict = {persons[i]: persons[i+1] for i in range(len(persons))[::2]}
# or for the edited list of lists
persons_dict = {pers[0]: pers[1] for pers in persons}
Now you can write things like:
print(persons_dict['Peter'])
Or test conditions and access to corresponding age like so:
a_person = raw_input('Give the name of a person\n')
print('The age of {0} is {1}'.format(a_person, persons_dict[a_person]))
if a_person == 'Peter':
print('You asked for Peter!')
If you want to work with lists, consider creating a list of lists (which you did in your edit):
persons = [[persons[i], persons[i+1]] for i in range(len(persons))[::2]]
now you can write:
if persons[0][0] == 'Peter':
print('The age of {0} is {1}'.format(persons[0][0], persons[0][1]))