In: Computer Science
two words that end in the same portion of letters but sound different are said to eye rhyme. write a python program that prompts the user for an input and prints all the words that eye rhyme with the input, words with the same last three letters, use dictionary file
# taking user input
word = input("Enter a word: ")
# taking words from dict file
f = open("dict.txt").read().split()
# checking if there is a match
# printing if so
for one in f:
if word[-3:] == one[-3:]:
print(one)
'''
SAMPLE FILE USED
chord
cart
ford
art
mart
short
sword
OUTPUT
Enter a word: word
chord
ford
sword
Enter a word: art
cart
art
mart
'''