How to find the index of value in python list?

How do i find duplicates in a list in Python?

  • I need to create a function that find duplicates in a list in python. I want it to return a boolian for True or False and i cant use the set function. It has to use while loops and counters. In the end it will looks something like this except hopefully it will work. birthdaylist = [1,3,2] counter = 0 for index in range(len(birthdaylist)): for indexB in range(len(birthdaylist)): if birthdaylist[index] == birthdaylist[indexB] and birthdaylist[indexB] != counter: print True counter += 1

  • Answer:

    Hire Chinese people.

Jhon adams at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

haystack = [1,5,6,3] needle = 6 if needle in haystack: print 'needle found' http://www.php2python.com/wiki/function.in-array/

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.