Tracing Code
Operators
Write Some Code!
100

What does this code print out?

is_sunny = True

print(not is_sunny)

False

100

What is the difference between the operators <= and <?

<= will return true if the LHS is less than OR equal to the RHS, but < will only return true if the LHS is strictly less than the RHS

100

Write one line that creates a screen turtle

<screen name> = turtle.Screen()

200

What does this code print out?

x = 5

y = 0

print(x < 6 and  y > 0)

False

200

What is the difference between these two operators: == and =

== checks if the RHS and LHS are equal (compares), while the = sets the value of a variable. BONUS: what is another name for =?

200

Write one line that sets the pen size of a turtle, named Bob, to 8.

bob.pensize(8)

300

What does this code print out?

https://trinket.io/python/a5dacaf664be

“No rain today”

“No rain today”

“No rain today”

“It is raining today”

300

When do the AND, OR, and NOT operators return True? (1 answer per operator)

AND- returns True if BOTH the RHS and LHS are True

OR- returns True if AT LEAST ONE of the RHS OR the LHS is True

NOT- returns True when put in front of a False value

300

Write THREE lines that will draw a square. (Assume a turtle named tim already exists in the program)