Page 94 - Trackpad v5 class 4
P. 94

LOGICAL OPERATORS

            Logical operators are used to combine two or more conditions. Logical operators are
            used when we want to test more than one condition and make a decision. It produces the
            results by considering if the conditions entered are true or false. In Scratch, there are three
            logical operators: ‘and’, ‘or’, and ‘not’.






                  Operator                Meaning                               Examples






                                    Logical and               when     clicked

                     and            The result is true if      if     100  > 50    and     100  > 60     then
                                    both the conditions         say 100 is greater than 50 and 60
                                    are true.







                                    Logical or                when     clicked

                      or            The result is              if     100  > 50    and     100  > 200    then
                                    true, if one of the         say 100 is either greater than 50 or 200
                                    statements is true.





                                    Logical not
                                    Reverses the              when     clicked
                                    condition, i.e. it’s             not
                   not                                        if             50  > 100     then
                                    false if the condition

                                    is true and                 say Reverses the condition
                                    vice-versa.






                   Hashtag


                 #Relational: Connection between two or more things
                 #Operators: A symbol or function donating an operation







             92   Pro (Ver. 5.0)-IV
   89   90   91   92   93   94   95   96   97   98   99