diff --git a/python program to print duplicates from list of integer b/python program to print duplicates from list of integer new file mode 100644 index 0000000..1bd675b --- /dev/null +++ b/python program to print duplicates from list of integer @@ -0,0 +1,18 @@ +# Python program to print +# duplicates from a list +# of integers +def Repeat(x): + _size = len(x) + repeated = [] + for i in range(_size): + k = i + 1 + for j in range(k, _size): + if x[i] == x[j] and x[i] not in repeated: + repeated.append(x[i]) + return repeated + +# Driver Code +list1 = [10, 20, 30, 20, 20, 30, 40, + 50, -20, 60, 60, -20, -20] +print (Repeat(list1)) +