# Boolean operators

This set of three operators (and, or, not) can be used to create multiple conditional expressions.

- and, if both conditions are true
- or, if either condition is true
- not, if the condition is not true

This example demonstrates all three operators being used.

    score as integer = 50
    lives as integer = 3

    do
    	if score = 50 and lives = 3
    		print ( "score is 50 and lives is 3" )
    	endif

    	if score = 50 and not lives = 3
    		print ( "score is 50 and lives is not 3" )
    	endif

    	if score = 25 or lives = 1
    		print ( "score is 25 or lives is 1" )
    	endif

    	sync ( )
    loop

- The first if statement checks whether the score is 50 and lives is 3. This condition is true.
- The second if statement checks if the score is 50 and lives is not 3. This condition is false as the lives variable has been set to 3.
- The third if statement checks if the score is 25 or lives is 1. This condition is false as neither of the conditions are true.

Try experimenting by setting score and lives to different values. How can the variables be set so that the second if statement becomes true? What needs to happen for the third if statement to become true?