New to programming. I'm trying to create a program that has a list o list (As a data base) the first element being an invoice, the second the value of that invoice and the third, the margin of income. Given an invoice (input), it will search within the list o lists(data base).
I currently have:
Data_base= [["f1",2000,.24],["f2",150000,.32],["f3",345000,.32]]
invoice = input("Enter invoice: ")
if invoice in data_base :
print ("Invoice is valid")
else :
print("Invoice does not exist, enter a valid document: ")
When I run the program and I enter a valid element within the list, it does not recognize as an element within the list.
What am I doing wrong?
What is the code to be given the index if the element is within the list of lists?