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 :: remove scientific notation python matplotlib 
Python :: python create file if not exists 
Python :: plt.xlabel not working 
Python :: adjust tick label size matplotlib 
Python :: linux uninstall python 
Python :: python index of max value in list 
Python :: python use .env 
Python :: print key of dictionary python 
Python :: python timeit commandline example 
Python :: check column type pandas 
Python :: pandas date_range 
Python :: pandas predict average moving 
Python :: create folders in python 
Python :: f string float format 
Python :: python implode list 
Python :: python randomize list 
Python :: increase pie chart size python 
Python :: regex email python 
Python :: python write yaml 
Python :: django import settings 
Python :: runner up score hackerrank 
Python :: pystfp how to listdir 
Python :: python wget anaconda 
Python :: sns scatter plot 
Python :: SSL handshake failed: localhost:27017 
Python :: python nextcord bot slash command 
Python :: matplotlib set y lim 
Python :: how to change python version on linux 
Python :: annaul sum resample pandas 
Python :: django model query add annotation field to show duplicate count 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =