4. Simple errors


#1

Just another way of thinking about the while loops.

this is one to remember our notandor statements

also we could do it by expanding the brackets or(and(not))

so remember

True and True = True

True and False = False

False and False = False

True or True = True

True or False = True

False or False = False

not True = False

not False = True

so the while statement is asking, is this true? so if you write or it only makes one of the parameters false so it says 'i am true and false' which is true. so I'm still true. so run the loop again.


#2

created the so-called _truth-table's_

    =======================
      AND  | true  | false
     ------|-------|-------
     true  | true  | false
     ------|-------|-------
     false | false | false
     ------|-------|-------
    
    =======================
     !(AND)| true  | false
     ------|-------|-------
     true  | false | true
     ------|-------|-------
     false | true  | true
     ------|-------|-------

    =======================
      OR   | true  | false
     ------|-------|-------
     true  | true  | true
     ------|-------|-------
     false | true  | false
     ------|-------|-------
 
    =======================
     !(OR) | true  | false
     ------|-------|-------
     true  | false | false
     ------|-------|-------
     false | false | true
     ------|-------|-------