-1

How Can I loop through this nested list based on input and it goes through the entire list and not just the index 1

anime = [['Naruto', 'Series', 'Shonen','Long'],
        ['Bleach','Series','Shonen','Long'],
        ['One Piece', 'Series', 'Shonen','Very long'],
        ['Death Note', 'Dark','High IQ','Series'],
        ['One Punch Man', 'Funny', 'Overpowered','Series'],
        ['Van Helsing', 'Dark', 'Gory',"Rated R", "Series"]]

mood = input("What mood are you inn? ")
for item in anime:
  if item[1] == mood or item[2] == mood or item[3] == mood:
    print(mood + ' anime: ' + item[0])
Andrej Kesely
  • 118,151
  • 13
  • 38
  • 75

0 Answers0