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.3-Boolean-Modify

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 the modify tasks, you are given some starter code. Use the instructions below to make changes to the code. Comment your changes to explain what you have done.

Adapt the code so that:

  • It gets user input for the name and hometown.
  • It ignores case for the user input.
  • It uses elif to combine into one single selection statement. The and should be on the if line, the or should be on the elif line.

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