Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python code begginer
#2
Hi,

simple mistake: you iterate over a list AND remove items from the list at the same time. Thus, you do not "catch" all items in the list.

Solution: create a 2nd list for the result and make use of the in operator to verify if an item is already in the new list. Or, more simple, use a set.

Regards, noisefloor
Reply


Messages In This Thread
python code begginer - by abdielG252 - Jun-22-2019, 07:23 PM
RE: python code begginer - by noisefloor - Jun-22-2019, 07:47 PM
RE: python code begginer - by perfringo - Jun-22-2019, 07:59 PM
RE: python code begginer - by ankit - Jun-24-2019, 07:56 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Coding begginer Verner 1 1,356 Jan-24-2022, 11:27 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020