Referenced from lesson Starting to Program

Pyret also has operators that work on Booleans. For each expression below, write down your guess about what it will evaluate to. Then type them in and see if you were right!

Expression

Guess what it will evaluate to

Does Pyret Agree?

(3 <= 4) and (3 == 2)

("a" == "b") and (3 <> 4)

(3 <= 4) or (3 == 2)

("a" == "b") or (3 <> 4)

not(10 > 2)

not( (3 <= 4) and (3 == 2) )

(3 <= 4) and not(3 == 2)

not( (3 <= 4) or (3 == 2) )

(not(3 <= 4) or (3 == 2))

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, and 1738598). CCbadge Bootstrap:Integrated Oklahoma by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.