"""
Experimenting with lists from CH3 of the book
7/24/24
"""

#This program asks the user for  an index position (in real terms) and delivers that item off the list
#first_names = ['Jane' ,  'Michael' , 'Steven' ,  'Maria'] 
#print("Enter a number between 1 and",  len(first_names))
#name_index = int(input())
#
#name_index = name_index - 1
#
#print(first_names[name_index])


#This program uses a while loop to ask the user what names to add to a list, then prints an element off that list

first_names = []
user_choice = 'y'

while user_choice == 'y':
    print("what name do you want to add to a list?")
    first_names.append(str(input()))
    print("Do you want to add another name? type y or n")
    user_choice = str(input())
    user_choice = user_choice.lower()
    while user_choice != "y" and user_choice != "n":
        print("y or n")
        user_choice = str(input())

print("Pick a number between 1 and" ,  len(first_names))
name_index = int(input())

name_index = name_index - 1

print(first_names[name_index])
