+ 1
How to find double letter in string?
7 Respuestas
+ 5
AARTI SHELAR , are you looking for a dedicated character to find, or you need to get all duplicated characters presented in a list or dict together with their number of occurrence? Should the duplicates be consecutive or does position not matter?
+ 4
please show us your attempt.
+ 4
A way of doing this with python modules would be using groupby():
from itertools import groupby
test = 'abbcccxxa'
print([''.join(g) for _, g in groupby(test)])
# result: ['a', 'bb', 'ccc', 'xx', 'a']
+ 2
Duplicate consecutive
0
S="google"
L=list(re.findall('\w\1',S))
0
It is not give deserve output!