+ 6
Repeating charachters
How can a function that takes one argument and only accept characters between a-z and remove any duplicates in the string be put in code form in Python. It should return a tuple with two variables 1. A new string with uniquely sorted characters. 2. The total number of duplicates dropped. e.g., rem_duplicate ('aabbac') => ('abc', 3) rem_duplicate ('a') => ('a', 0) rem_duplicate ('theleash')=>('aehlst', 2)
5 Réponses
+ 5
Already corrected the mistake
+ 1
these examples are wrong
+ 1
use a list to count the numbers of each alphabet
+ 1
This doesn't check for a-z range:
https://code.sololearn.com/c4ehY66V1upT/?ref=app
+ 1
https://code.sololearn.com/cMCzwF9TMzoE