diff --git a/Level-01-Starting/more solutions/s03-youthM.py b/Level-01-Starting/more solutions/s03-youthM.py new file mode 100644 index 0000000..290ae12 --- /dev/null +++ b/Level-01-Starting/more solutions/s03-youthM.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +def checkio(data): + return [i for i in data if data.count(i) > 1] + +if __name__ == '__main__': + assert checkio([1, 2, 3, 1, 3]) == [1, 3, 1, 3] + assert checkio([1, 2, 3, 4, 5]) == [] + assert checkio([5, 5, 5, 5, 5]) == [5, 5, 5, 5, 5] + assert checkio([10, 9, 10, 10, 9, 8]) == [10, 9, 10, 10, 9] + print("Coding complete? Click 'Check' to review your tests and earn cool rewards!")