import sys

shopping_list = ['bread', 'cheese', 'milk', 'chocolate']
prices = [4.99, 6.99, 2.99, 7.67]
shopping_list.append('cucumber')
prices.append(1.99)

shopping_list.append('tomato')
prices.append(4.99)


print(shopping_list)
lenght_of_shopping_list = len(shopping_list) - 1
try:
    choice = int(input(f'Select one element in the list above by writing it index (0 - {len(shopping_list) - 1}): '))
except:
    print('Your choice is not a number')
    sys.exit()

try:
    print(f'Your choose : {shopping_list[choice]} with price: ${prices[choice]} ')
except:
    print(f'The index you choose is out ofthe list')
    
    
    
# backpack = ['workbooks', 'pencilcase', 'studentbooks', 'knife']

# print(backpack[2])
# print(backpack[1])
# print(backpack[3])

# backpack.append()


