how to find common characters in two strings in python

Solutions on MaxInterview for how to find common characters in two strings in python by the best coders in the world

showing results for - "how to find common characters in two strings in python"
Julia
11 Jan 2017
1#find common elements present in 2 strings
2str1 = 'abcdef'
3str2 = 'abcdf'
4com_str = ''.join(set(s1).intersection(s2))
5print(com_str)
Anton
11 May 2017
1for i in str1: 
2        if i in str2:
3      			return "TRUE"
queries leading to this page
you are given two strings of same length determine whether they share any commom substringfind the common word from the multiple string pythoncommom sub string in 2 strings pythoncommon letters in 2 strings pythonhow to find common substring in two strings in pythonfind a common substring between two stringshow to print common string in two strings in pythoncompare two strings and find common elements in pythonfirst common characters in two strings pythonhow to count common words from two string in pythoncommon substring in two strings pythonfind common string in two list python stringpython common substring in two stringcommon string between two strings in pythonhow to identify common string in two stringshow to find common contiguous substring in two strings in pythonhow to find common words in two strings pythonfind common elements in two strings pythonfind common substring in two strings java using regexfind common content in string in pythonmatch lists of strings based on common strings pythonhow to find common characters in two strings in pythonfind common letters in two strings pythonprint common characters in two strings in pythonfind most common letter pythonpython find common element in two stringscommon elements in two strings pythonhow to find common letters in two strings pythonfind common substring between two strings in pythonhow to find common substrings in same place in pythoncheck if two strings have a common substring jspython find common words in two stringspython code to find common parts in 2 stringsgolang find common value in two stringsfind common substrings in two strings pythonget common substring pythonhow to find common words in two diferent strings in pythonhow to take the common elements from the two strings pythonmost common letter in string pythonpython find common substring between two stringsfind common substring javafind common substring between two strings pythonhow to print common elements in two strings in pythonfind common elements in list of strings pythonhow to test whether two string have same substring pythonfind common letter in one string pythonfind different words in two strings pythonpython find common substring in two stringscommon string between two strings pythoncommon characters in two strings pythonfind common words in two strings pythoncheck if two strings have a common substringfind the common part of the stringfind common substring in two strings pythonfind common words in 2 strings pythonhow to find common words in two strings in pythonfind common characters in two strings in pythonfind common string in two strings pythonfind common characters in two strings pythonshortest way to find common letters in two strings pythonget common part from two strings from starting in pythonfind a common string between to stringsfind common string in two stringsfind a common string between two stringspython find two string common exthow to find common characters in two strings in python