Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python count distinct letters

string = 'aabbcd'
unique = []
for char in string[::]:
    if char not in unique:
        unique.append(char)
print(len(unique))
Comment

PREVIOUS NEXT
Code Example
Python :: say command python 
Python :: python check numpy arrays equal 
Python :: Get all columns with particular name in string 
Python :: how to test wifi speed py 
Python :: pandas plot histogram 
Python :: python ignore exception 
Python :: python utf8 
Python :: pygame.key.get_pressed() 
Python :: how to sort values in python from dictionary to list 
Python :: python how to change size of a window 
Python :: python merge two dictionaries 
Python :: how to count in a loop python 
Python :: python voice recognition 
Python :: pyqt5 qpushbutton disable 
Python :: pandas replace space with underscore in column names 
Python :: get last element of array python 
Python :: set jupyer color to dark 
Python :: how to create a loop in python turtle 
Python :: python 3.9.5 installed update default version 
Python :: accuracy score 
Python :: python sklearn linear regression slope 
Python :: python count hex 
Python :: django dumpdata 
Python :: python run a system command 
Python :: convert video to text python 
Python :: selenium get back from iframe python 
Python :: how to add value to to interger in python 
Python :: get all h1 beautifulsoup 
Python :: print a text in python 
Python :: python program running time 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =