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 7691607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:39:51+00:00 2026-05-31T20:39:51+00:00

I know this question has been discussed before, and I know this is such

  • 0

I know this question has been discussed before, and I know this is such a novice and easy question, but for some reason I can’t wrap my head around the code that would be needed to do this. Here is a practical example that I need this for:

Lets say I contain a tumblr account, and I follow 5 people, of which 3 follow me back.

iFollow = [Tom, Richard, Bob, Samantha, Kat]
followsMe = [Samantha, Kat, Bob]

Now, I want to unfollow the people that I follow, however don’t follow me back.
So in this example I would want to unfollow Tom and Richard, because even though I follow them, they don’t follow me. I would like to create a list:

unfollowThese = [Tom, Richard]

I can’t for the life of me figure out how to do this. I know there is intersect, find the common elements, that would output “Bob”, it seems like I want the opposite, I want elements that are common in both lists removed from the new list that I want to make.

I.E. I want elements common in iFollow and followsMe to be removed from unfollowThese, as I don’t want to unfollow my followers.

Thanks.

p.s. if you can think of a better title, please change it, I couldn’t think of anything to call it..

  • 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-31T20:39:52+00:00Added an answer on May 31, 2026 at 8:39 pm

    Using list comprehensions if order matters:

    unfollowThese = [ person for person in iFollow if person not in followsMe ]
    

    Using sets if the order of items does not matter:

    import sets
    s1 = sets.Set(iFollow)
    unfollowThese = s1.difference(followsMe)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this question has been asked before, but I tried eveything and can't
I know this question has been asked before, but I ran into a problem.
I know this question has been asked a bit before. But looking around I
I know this question has been posted before... but I haven't found any answer
I know this question has been asked before, but I haven't been able to
I know this question has been asked before numorous times but they seem to
I know this is a question that has been discussed over and over, but
I know this question has been asked before, but none of the previous answers
I know this question has been asked before but the solutions did not work
I know this question has been answered before in this thread , but I

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.