If there is a string = '99888' it should print 'True'. How can you check pairs and threes of a character in a string
I tried using the count function but it only identifies a pair
string = '99888'
for c in '123456789':
if string.count(c) == 2 and string.count(c) == 3 :
print('True')
Edit: The string is a always 5 character string and if there is a pair and three of a kind it prints True For example '89899' and '75757' print True. '98726' prints False