python 3 the code must recieve two lines of input 1. the hidden word 2. the guessed word the output should print whether
Posted: Wed Apr 27, 2022 5:04 pm
python 3
the code must recieve two lines of input
1. the hidden word
2. the guessed word
the output should print whether the letters in the guessed word are in the hidden word or either their are in the same postion or the letter in the guessed word does not exsit in the hidden word
if the letter of the guessed word is in the same position as the letter of the answer word then then it should output as is
or else if the letter in the guessed word is in the hidden word but not in the same position then it sohuld output in lower case
if the letter of the guessed is not in the hidden word then it sohuld output by a dot(.)
so example (SAMPLE INPUTS)
TEETH
JETTY
output=.EtT.
SPOON
SWOOP
output=S.OOp
HAPPY
POPPY
output= ..PPY ## NOTE here the output is not p.PPY because the the 2 Ps of the guessed word are alredy equivlient to the 2Ps of the hidden word therefore there is not more more p remaining in the hidden word and thus it is replace by a dot
ZABBZ
CBBXX
output=.bB..
ZABBZ
CBBBX
output=..BB.
ZABBZ
CBBXB
output=.bB.. # NOTE the output is SHOULD NOT BE .bB.b
ABBCD
BAEBA
output= ba.ba
ABBCA
BAEBA
output=ba.bA
the code must recieve two lines of input
1. the hidden word
2. the guessed word
the output should print whether the letters in the guessed word are in the hidden word or either their are in the same postion or the letter in the guessed word does not exsit in the hidden word
if the letter of the guessed word is in the same position as the letter of the answer word then then it should output as is
or else if the letter in the guessed word is in the hidden word but not in the same position then it sohuld output in lower case
if the letter of the guessed is not in the hidden word then it sohuld output by a dot(.)
so example (SAMPLE INPUTS)
TEETH
JETTY
output=.EtT.
SPOON
SWOOP
output=S.OOp
HAPPY
POPPY
output= ..PPY ## NOTE here the output is not p.PPY because the the 2 Ps of the guessed word are alredy equivlient to the 2Ps of the hidden word therefore there is not more more p remaining in the hidden word and thus it is replace by a dot
ZABBZ
CBBXX
output=.bB..
ZABBZ
CBBBX
output=..BB.
ZABBZ
CBBXB
output=.bB.. # NOTE the output is SHOULD NOT BE .bB.b
ABBCD
BAEBA
output= ba.ba
ABBCA
BAEBA
output=ba.bA