• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Remove duplicates from a list and remove elements at same index in another list

Resolved: Remove duplicates from a list and remove elements at same index in another list

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I have two lists, one with word and another one with word type like this
I need to remove duplicates in the first list and to remove the type at the same index of the word removed.
In the end I need something like this:
How can I do that?

Answer:

This would be much easier with dictionaries (see below)

With lists


Output:

With a dictionary


Output:

If you have better answer, please add a comment about this, thank you!

duplicates list python
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How to scroll bottom of div at launch?

02/04/2023

Resolved: how to get and read an xml file in a zip file using xml.etree

02/04/2023

Resolved: The ‘Access-Control-Allow-Origin’ header contains multiple values ‘*, *’, but only one is allowed. cors error not resolving

02/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.