As the image shows, If doesn't return "Fail" if the condition didn't succeed, but works when conditions match. Why did that happen and how can I fix it?
Asked
Active
Viewed 368 times
1

If[First @ prefix === P, "Correct", "Fail"]? – kglr Dec 12 '20 at 07:11If[First@prefix == P, "Correct", "Fail", "Fail"]? – kglr Dec 12 '20 at 07:11Equal,SameQ, andPossibleZeroQare discussed under "Background and Context" in the docs forEqual. There are also contrasting examples illustrating some of the points shown under "Properties & Relations." – Michael E2 Dec 12 '20 at 17:09