Question: Write in python Gematria is the act of assigning numeric values to letters in an alphabet. Once each letter is assigned a value you can
Write in python
"Gematria is the act of assigning numeric values to letters in an alphabet". Once each letter is assigned a value you can compute the value of a word or phrase by simply summing the values of each letter in the word/phrase. Using a mapping of a=1, b=2, c=3, ..., z=26, "Phil" has a value of P=16 + h=8 + i=9 + l=12 == 45. This function that takes a word and the name of a dictionary file, and then returns a list of all the entries from the dictionary that gematrically match the given word. Note that the case of a letter does not change its value.
def gematria(word_to_match, filename): """ Takes a word and the name of a dictionary file, and then returns (a list of) all the entries from the dictionary that Gematrically match the given word.
"Gematria is the act of assigning numeric values to letters in an alphabet" -- (https://en.wikipedia.org/wiki/Gematria, last access 10/7/2017). Once each letter is assigned a value you can compute the value of a word or phrase by simply summing the values of each letter in the word/phrase. Using a mapping of a=1, b=2, c=3, ..., z=26, "Phil" has a value of P=16 + h=8 + i=9 + l=12 == 45. Note that the case of a letter does not change its value.
:param word_to_match: the word for which you are trying to find a Gematric match :param filename: the dictionary file containing other candidate words
>>> gematria('Phil', 'small_dict.txt') ['bios', 'coder', 'gore', 'knife', 'racer'] """ # replace pass below with your code pass
You can use the same input files you used for filtering a dictionary (except the 500 Worst Passwords file, as noted above).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
