Jun-23-2021, 05:46 AM
Hi,
I have a list items and I have some other lists that is done through coding. I need later to check if there are any items in the other lists then add them to the original items list.
I have a list items and I have some other lists that is done through coding. I need later to check if there are any items in the other lists then add them to the original items list.
items_laptops = pd.DataFrame([ ["Item Name(Brand)"," Price(AED/Unit)"], ["Acer Aspire 3", "1698"], ["Asus Vivobook 15", "1999"], ["HP Pavilion x360", "2479"], ["Dell XPS 13", "3499"], ["HP ProBook 450", "3849"], ["HP EliteBook 840", "4299"], ["Dell XPS Ultrabook", "5399"] ]) items = [["Item Type", "Item Name", "Price AED"]] len_laptops = len(laptops) # after checking which one to buy from tkinter checkboxes if len_laptops > 0: for i in range(len(laptops)): items.append(laptops[i])so I have other list called laptops, I need to check if there are items inside the list then if yes I need to add them to the items list with the same format - each list has 3 values as it shows in the items list - ("Item Type", "Item Name", "Price AED") so for the laptop list it might have ["Laptops", "HP","3000"] so i need to take them as 3 entries in items list. so an example of the items list now should look like this
items = [["Item Type", "Item Name", "Price AED"], ["Laptops", "HP","3000"] ]Note: using the above code give me an error:
Error:TypeError: 'int' object is not iterable
Thanks