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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:52:44+00:00 2026-06-14T23:52:44+00:00

I am trying to learn recursion. I am trying to take a list as

  • 0

I am trying to learn recursion. I am trying to take a list as a parameter and return a new list in which the values that were in the old list appear only once in the new list.
I have been going at this for hours but keep getting stuck.

  • 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-06-14T23:52:45+00:00Added an answer on June 14, 2026 at 11:52 pm
    if (old_list[0] not in new_list):
    

    Notice that new_list will always be empty at this point, so this condition will always be true and all elements will be added to the new list.

    Your code is one little tweak away from functioning correctly. Instead of checking if the item is in the new_list, I think you should be checking if it’s in the rest of the old list:

    if (old_list[0] not in old_list[1:]):
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to learn recursion on my own. I've done the following exercise which
im trying to learn delegates and events in c#, i understand that an event
I'm trying to learn a little bit more about recursion but somehow I can't
Novice programmer here. trying to learn static methods and recursion. No idea why I
I'm currently trying to learn Knockout.JS - I'm also relatively new to JavaScript itself.
I am new to Scheme - I am currently trying to learn the syntax
I am trying learn more about JSP expression evaluations. How and which variables are
I'm trying to learn the concepts OpenMP and stumbled upon a case which I'm
Trying to learn PL/SQL with multimedia data. Can anyone please point out that from
Im trying to learn class-based views, for a detail or list view is not

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.