If numbers contains duplicate values, .index() will always return the index of the first occurance, messing up your results. There are easier ways to keep track of indexes with built-ins in Python.
numbers
.index()
already fix it
This is literally what this challenge asks you to figure out :)
You can try to write some small values on paper and see if some patterns emerge.
Loading collection data...
If
numbers
contains duplicate values,.index()
will always return the index of the first occurance, messing up your results. There are easier ways to keep track of indexes with built-ins in Python.already fix it
This is literally what this challenge asks you to figure out :)
You can try to write some small values on paper and see if some patterns emerge.