Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to find common characters in two strings in python

#find common elements present in 2 strings
str1 = 'abcdef'
str2 = 'abcdf'
com_str = ''.join(set(s1).intersection(s2))
print(com_str)
Comment

find common string in two strings python

for i in str1: 
        if i in str2:
      			return "TRUE"
Comment

PREVIOUS NEXT
Code Example
Python :: insert row in dataframe pandas 
Python :: python regex validate phone number 
Python :: pytest debug test 
Python :: heroku python heroku port issue 
Python :: how to create a string in python 
Python :: guardar plot python 
Python :: python - How to execute a program or call a system command? 
Python :: os dir exists 
Python :: sys.maxsize() in python 
Python :: python day of the year 
Python :: python for loop 
Python :: views django 
Python :: python sort 2d list different sort order for different columns 
Python :: flask migrate multiple heads 
Python :: how to join basename and directory in python os 
Python :: tkinter how to update optionmenu contents 
Python :: python remove item from a list 
Python :: telegram.ext package 
Python :: python jointly shuffle list 
Python :: change gles3 to gles2 
Python :: python wrapper function 
Python :: find median pandas 
Python :: how to plot side by side bar horizontal bar graph in python 
Python :: form field required in django views 
Python :: python try 
Python :: symbolic variables python 
Python :: tensorflow io check file exist 
Python :: Using strip() method to remove the newline character from a string 
Python :: hide verbose in pip install 
Python :: class python __call__ 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =