Friday, 22 November 2019

42 #iNTRODUCING DATA FROM PROMPT. EXTENDED

#iNTRODUCING DATA FROM PROMPT. EXTENDED


friendNames = []
while True:
    print('Enter name of a friend ' + str(len(friendNames) + 1) +
' (Or enter F when finished.):')
    name = input()
    if name == 'F':
        break
    friendNames = friendNames + [name] # list concatenation

while True:
    print ('Name a friend to check he is in the list')
    print ('Type FFF to finish')
    CHECK = input()
    if (CHECK) in friendNames:
        print ('Yes')
        print()
    elif (CHECK) == ('FFF'):
        break
    else:
        print ('Nope, this name is not in the list')
        print ()

print ('Do you want to see the complete list?')
YESNO = input()
if YESNO == ('yes'):
    print('The friends names are:')
    for name in friendNames:
        print(name)
else:
    print ('Let´s continue')