Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python program that takes 2 words as input from the user and prints out a list containing the letters that the 2 words have in common

firstWord = input("Enter the First word: ").lower()
secondWord = input("Enter the Second word: ").lower()
print("----------------------")
hehe = []
for i in firstWord:
    for j in secondWord:
        if i == j:
            hehe.append(j)

print(hehe)
print("----------------------")
 
PREVIOUS NEXT
Tagged: #Python #program #takes #words #input #user #prints #list #letters #words #common
ADD COMMENT
Topic
Name
6+9 =