top of page

If Operations

Checkpoint #1

Whitespace

Elif

Checkpoint #2

Nested If

Summary

Checkpoint #2

Now it's your turn!

  1. Store your eye color in a variable as a string. Then, write an if statement that prints "Your eyes are brown!" if they are brown and prints "Your eyes are not brown!” if they aren’t.

  2. There are lots of other eye colors besides brown, so let's make our solution more comprehensive. Now have an if statement for brown eyes, blue eyes, green eyes, and an "else" statement if none of those colors apply. For each if statement, print "Your eyes are" (the appropriate color).

bottom of page