persons Ivanov ivan ivanovich volkhonskiy denis alekseevich moiseeva n

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
persons = ['Ivanov ivan ivanovich', 'volkhonskiy denis alekseevich', 'moiseeva nastya borisovna', 'nastya tichkina', 'denis gorev']
def find_by_name(name):
print name
print ''
words = []
for person in persons:
print person
if name in person:
words.append(person)
if len(words) == 0:
print 'Sorry, there is no person with such name'
else:
print words
find_by_name('katya')