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.


Task Modify

Adapt the code so that:

  • The user is asked at the end if they guessed correctly
  • If they did, display a “Well done” message
  • If they didn’t, display a “Never mind” message
  • As well checking whether the answer is too high or too low, add a line that checks whether the guess is equal to the answer and if it isn’t, displays a “Bad luck” message
  • Add comments to explain what you have changed.

Help! My code doesn’t work

Make sure that you check for the following things:

  • A colon at the end of each if and else line.
  • Each branch is indented unsing the TAB key (not just spaces)
  • No condition after ‘else’
  • A double equals in the condition when chcking that two pieces of data are the same.