OmarAlmighty/Introduction-to-Programming-Using-Python-Liang-1st-edtion

output wrong in Chapter 4 exercise 4.15

Closed this issue · 3 comments

suppose the random number is 169 and you enter 999 it says matches all digits but that's wrong. becuase n1, n2, n3 matches g3 Your conditions are only checking if the numbers are matched with every other number. they are not restricting that one number has been checked and need not to be checked again. like if n1 matches g3; these numbers are locked and g3 must not be checked against n2 or n3

I actually do not know the answer to this and that is how I stumbled upon your repository. might update you if I can come up with a solution.

I've fixed the second condition.

Screenshot from 2021-06-08 13-19-41

now the third condition is not working like if you take first and second digit the same and 3rd digit different it won't detect that one digit already matched and i think it can be solved if we wrote a few more statements to check if they g1 matches either n1, n2, n3

I've fixed the third condition. Thanks for reporting.