Python Program that displays which letters are present in both the strings
Description:
Let us assume that there are two input strings "hey" and "hello". We have to find the common letters between both of them.
for this purpose, we have to use "l" operator after converting both strings into sets.
Input Code:
str1= input("Enter Your first string: ") str2=input("Enter Your second string: ") s=list(set(str1)|set(str2)) print("The letter which are present in both strings are:") for i in s: print(i)
Comments