- 1

Remove_duplicates function (in Python) challenge.

Write a function called remove_duplicates which will take one argument called string. This string input will only have characters between a-z. The function should remove all repeated characters in the string and return a tuple with two values: A new string with only unique, sorted characters. The total number of duplicates dropped. For example: remove_duplicates('aaabbbac') => ('abc', 5) remove_duplicates('a') => ('a', 0) remove_duplicates('thelexash') => ('aehlstx', 2)

10th Apr 2017, 1:48 PM
Obongekeme Udo
Obongekeme Udo - avatar
4 Antworten
10th Apr 2017, 2:11 PM
Tob
Tob - avatar
+ 2
https://code.sololearn.com/cwmHiKzwYPzh/?ref=app
10th Apr 2017, 2:17 PM
Eranga
Eranga - avatar
0
@Tobi you are very correct
10th Apr 2017, 3:22 PM
Obongekeme Udo
Obongekeme Udo - avatar
11th Apr 2017, 4:53 PM
Klaus-Dieter Warzecha
Klaus-Dieter Warzecha - avatar