79659815

Date: 2025-06-10 05:18:07
Score: 1
Natty:
Report link

Mark pointed out the problem was with using .index which only returns the first occurrence.

Alternately you can either:

  1. use range(theLengthOfYourList) and loop a position through that.

  2. or use a list comprehension with enumerate() which will return all instances where the value you are looking for occurs without having to use loops.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: JustinPhi