This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Dexter Ramos
Recipients Dexter Ramos, eric.smith, paul.moore, steve.dower, tim.golden, zach.ware
Date 2020-08-01.14:07:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1596290861.0.0.687564431192.issue41454@roundup.psfhosted.org>
In-reply-to
Content
Thank you Mr. Erick Smith. Now I know. I also tried to find the hard way like this:

--------finding nemo-------------
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4] --->index
[4, 1, 2, 5, 7, 4, 2, 8, 9, 5, 3, 2, 4, 6] --->original list
 /                                         --->started at index 0 with value of 4
[1, 2, 5, 7, 2, 8, 9, 5, 3, 2, 6, 4] --->1st iteration, all 4's are removed then appended so the index adjusted
    /                                --->next at index 1 with a value of 2 (whereas value 1 was skipped which had index 1 originally; this is not seen on the output because it has no duplicate)
[1, 5, 7, 8, 9, 5, 3, 6, 4, 2] --->3rd iteration
       /                             --->next at index 2 with value of 7; value 5 was skipped which had the index 2 originally; cause found!
[1, 5, 8, 9, 5, 3, 6, 4, 2, 7] --->4th ...
...
---------------nemo found-----------------------
Credits to you.

Here is the new working code:
-------code------------------------------------------------
bunchofnumbers = [4, 1, 2, 5, 7, 4, 2, 8, 9, 5, 3, 2, 4, 6]
for eachnumber in bunchofnumbers.copy():
    while eachnumber in bunchofnumbers:
        bunchofnumbers.remove(eachnumber)
    bunchofnumbers.append(eachnumber)
bunchofnumbers.sort()
-------end of code-----------------------------------------
OUTPUT:
[1, 2, 3, 4, 5, 6, 7, 8, 9]
print(bunchofnumbers)
History
Date User Action Args
2020-08-01 14:07:41Dexter Ramossetrecipients: + Dexter Ramos, paul.moore, eric.smith, tim.golden, zach.ware, steve.dower
2020-08-01 14:07:40Dexter Ramossetmessageid: <1596290861.0.0.687564431192.issue41454@roundup.psfhosted.org>
2020-08-01 14:07:40Dexter Ramoslinkissue41454 messages
2020-08-01 14:07:40Dexter Ramoscreate