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
Post a Comment