import sys
#in_backpack = ["pencil", "book", "notebook", "crayon"]
#prices = [4.99, 6.99, 2.99, 7.49]
#in_backpack.append("cucumber")
#prices.append(1.99)

#in_backpack.append("tomato")
#prices.append(4.99)

#lenght_of_in_backpack = len(in_backpack) - 1
#print(in_backpack)
#choice = int(input(f"Select one element in the list above by writing its index (0 - {lenght_of_in_backpack}: "))

#print(choice)

# in_backpack[choice]

# try:
   # in_backpack.remove("gun")
#except:
   # print("Gun is not on the list")

shopping_list = ["bread", "cheese", "milk", "chocolate"]
prices = [4.99, 6.77, 2.99, 7.49]
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 - {lenght_of_shopping_list}): "))
except:
    print("You choose wrong")
    sys.exit()

print(f"You chose: {shopping_list[choice]} with price ${prices[choice]}")









