Reference no: EM132355245
Question
(a) Write program named commonLetter.py that prompts user to enter two words, and display the positions of the first occurrence of common letter in both words. For example, if the words entered are 'assignment' and 'examination' respectively, then the first common letter is 'a', and the positions printed are 1 and 3 respectively. If there is no common letter between the words, for example, 'private' and 'school', then display an appropriate message to inform user about this.
NOTE: We will use the letters of the first word to check against the letters in the second word, and NOT the other way round. So, for example, if the words entered now are 'Examination' and 'assignment' in that order, then the first common letter now is 'e', and the positions printed are 1 and 8 respectively.
(b) Enhance the program in (a) by displaying the words as word-cross. For the words above, the display would look like the following:
assignment Examination PYTHON Private
examination assignment Common school
EXAMINATION ASSIGNMENT P An appropriate message
S X Y informing user that there
S A T . is no common letters
I M H . between the words
G I COMMON
N N N
M A
E T
N I
T O
N
NOTE: i) The first word will be displayed vertically, whereas the second is displayed horizontally.
ii) The comparison should ignore the case, that is E and e should be considered the same.