You will write the conditional and its three relatives as Python functions, then let the program find which pairs say the same thing.
The idea. Python has no "implies", so write as (not p) or q. The converse swaps the parts, the inverse negates them, the contrapositive does both.
Your tasks.
implies(p, q).contrapositive(p, q), the value of . Use implies.differ(f, g). Return the number of rows, out of four, in which f and g give different values.Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…