menu = [ ["bacon", "eggs"]" ["bacon", "spam", "eggs ", "cheese"], ["sausages", "cheese", "spam", "coco cola"], ["spam", "spam", "spam"], ["eggs", "cheese", "tea", ] ] for meal in menu: for x in range(len(meal) - 1, -1, -1): if meal[x] == "spam": del meal[x] print(meal[len(meal)-1], meal[len(meal)-2], sep="and")
meal[len(meal)-1]
meal[len(meal)-2]
QuotePython for x in range(len(meal) - 1, -1, -1):
for x in range(len(meal) - 1, -1, -1):
range
-1
meal[-1]
["spam", "spam", "spam"]
len(meal)
0
meal[0 - 1]
meal[0 - 2]
if len(meal) > 1: print(meal[len(meal)-1], meal[len(meal)-2], sep="and")
menu = [ ["bacon", "eggs"]" # ^ may be the quote here do not help ["bacon", "spam", "eggs ", "cheese"], ["sausages", "cheese", "spam", "coco cola"], ["spam", "spam", "spam"], ["eggs", "cheese", "tea", ] # ^ may be the comma here do not help ]
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)