Question: Question 4 . 1 . Now, complete the implementation of the function emojify, which takes as input two five - letter strings, each having no

Question 4.1. Now, complete the implementation of the function emojify, which takes as input two five-letter strings, each having no repeated letters. The first input string, guess, should be cross-checked with each letter of the second input string, answer. The function should return a new string, formed entirely of emojis from the emojis array, that indicates the accuracy of each letter in the guess, as described in the rules above. For example, let's say the answer string is 'shark'. Here is how the function would work on various example guesses.
>>> emojify('crept', 'shark')
''
>>> emojify('chalk', 'shark')
''
>>> emojify('harks', 'shark')
''
>>> emojify('sharp', 'shark')
''
>>> emojify('shark', 'shark')
''
Note: As we did in the preceding example, use the array emojis to access the emojis don't actually include any colored square emojis in the code you write below.
Hints:
Look at the slide titled Ranges in Lecture 10 for guidance.
You'll need to use the in keyword, which we also introduced in Lecture 10.
Remember to write a general function that works for any answer word, not just 'shark'.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!