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 Jen Poole is licensed under a Creative Commons 4.0 Unported License. Based on a work at www.BootstrapWorld.org. Permissions beyond the scope of this license may be available by contacting schanzer@BootstrapWorld.org.