Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python string in set

a_string = 'Hello World Hello'

# In case we want to get a 'set' of chars
print(set(a_string))
# Output -> {'W', 'r', 'l', 'H', 'd', ' ', 'o', 'e'}

# In case we want to get a 'set' of words
print(set(a_string.split()))
# Output -> {'Hello', 'World'}
Comment

PREVIOUS NEXT
Code Example
Python :: work with gzip 
Python :: django clear all sessions 
Python :: how to custom page not found in django 
Python :: convert datetime to date python 
Python :: feature importance plot 
Python :: pandas select a row 
Python :: Python Requests Library Post Method 
Python :: how to get current latitude and longitude in python 
Python :: iterate through an array python 
Python :: batchnormalization keras 
Python :: beautiful soup documentation 
Python :: numpy array length 
Python :: valor absoluto en python 
Python :: get absolute url django 
Python :: play sound on python 
Python :: pyauto gui save screenshot 
Python :: # find out of the memory of the python object 
Python :: secondary y axis matplotlib 
Python :: ImportError: dynamic module does not define module export function 
Python :: outliers removal 
Python :: how to set background image in python tkinter 
Python :: first column of a dataframe python 
Python :: python scheduling 
Python :: python dictionary rename key 
Python :: how to count the occurrence of a word in string python 
Python :: strip first occurence of substring python 
Python :: get context data django 
Python :: python how to make notepad 
Python :: pygame zero how to draw text 
Python :: count number of each item in list python 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =