Homework Hacks 📕

Review the instructions and examples in the lesson and create a truth table using Python. Additionally look up and learn about De Morgan’s Law and see how it can be used to create a boolean expression.

Here is an example:

function deMorganLaw() {
    console.log("A      B        Result");
    let values = [false, true];

    for (let A of values) {
        for (let B of values) {
            let result = !(A && B) === (!A || !B);
            console.log(`${A}  ${B}  ${result}`);
        }
    }
}

deMorganLaw();

Result:

A      B        Result
false  false    true
false  true     true
true   false    true
true   true     true

Take a quiz

Test out your skills with this quiz.

Quizizz Link