Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

count occurrences of a character in a string python

#finds occurances 
def duplicatecharacters(s:str):
    for i in s:
        if s.count(i)>1:
            return True
    return False
print(duplicatecharacters(""))
 
PREVIOUS NEXT
Tagged: #count #occurrences #character #string #python
ADD COMMENT
Topic
Name
1+6 =