How to compare values within an array in Python - find out whether 2 values are the same -


i have array of 50 integers, , need find out whether of 50 integers equal, , if are, need carry out action.

how go doing this? far know there isn't function in python there?

if mean have list , want know if there duplicate values, make set list , see if it's shorter list:

if len(set(my_list)) < len(my_list):     print "there's dupe!" 

this won't tell duplicate value is, though.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -