replit

Before you start this course, you must login to Replit

If you have forgotten your Replit account user name or password, ask your Coder Coach.

CodeSports

9.4-Boolean-Make

Learning Objectives/Goals

Be able to read, comprehend, trace, adapt and create Python code using selection that:

  • Uses Boolean operators with multiple conditions.

Task Instructions

In these tasks you have to use the skills learned in the previous exercises to create a new program based on the requirements below.

Write a program that:

  • Stores your eye colour, hair colour and the number of pets you have in three separate variables.
  • Asks the user to guess them one by one and stores their answers in three more variables.
  • Prints ‘You guessed them all’ if the user gets all 3 correct.
  • Prints ‘You got some, but not all correct’ if the user gets one or two correct.
  • Prints ‘You didn’t get any right’ if the user gets them all wrong.

Help! My Code Does Not Work!

Make sure that you check for the following things:

  • there is a full condition (two pieces of data and a comparison operator) on **each side ** of the Boolean operator. Example:
x < 5 and  x < 10
  • the Boolean operator is in lower case
  • the correct Boolean operator for the result you want has been used (check the logic)

Hints