Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6746473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:19:37+00:00 2026-05-26T12:19:37+00:00

Consider a list o emails: [‘a@amail.com’,’b@bmail.com’,’c@cmail.com’,…] I want to compare list items with each

  • 0

Consider a list o emails:

['a@amail.com','b@bmail.com','c@cmail.com',...]

I want to compare list items with each other. For example emails would be unique.
What is the way for compare items of list with each other in Python?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:19:38+00:00Added an answer on May 26, 2026 at 12:19 pm

    If you just want to test whether or not there were duplicates in the list, you can use:

    if len(set(list_o_emails)) == len(list_o_emails):
        # all are different
    else:
        # you had a duplicate
        raise forms.ValidationError # from your comment
    

    since set will eliminate any duplicates for you and comparing the lengths will tell you whether or not any duplicates were removed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider a production planning application with many products. Each product has a list of
Please consider this site . I'm having trouble stretching the submenu list items in
Consider a list of Label : Collection<Label> labels = new Collection<Label>(); Now i want
Ok, consider this problem. I have a list of email addresses and each email
Consider the following scenario representing a list of items on the left side and
Consider this table structure people{id,firstName,lastName,preferredName} list{id,person1_id,person2_id} I want to get all data from list
Consider having a list - Ferrari, Mclaren, Red Bull on A2, A5, A8 cells,
Consider the following data structure: List<Person> People; class Person { List<Car> Cars; List<Hobby> Hobbies;
Consider the following code: List<double> l = new List<double>(); //add unknown number of values
Consider this Python code for printing a list of comma separated values for element

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.