On Thu, 1 Jun 2017 10:29 am, David D wrote:

Is there a way of performing this
where the key will update so that is continues to work sequentially?

It sounds like you don't want a dictionary at all, you want a list.
You can use the index() method to find the current "key" of an entry.

>>> people = ["John", "David", "Phil", "Bob"]
>>> people.index("Phil")
2
>>> people.remove("David")
>>> people.index("Phil")
1

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to