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

Output A Range Of Items From A List

Need more help with lists? Click here

Predict and Run

What’s a Predict & Run task?

In these tasks you will be given one or more examples of code.

  • Look at each example, see how they work.
  • Write what you think is going to happen when the program runs. Your prediction should be added to the code as comments.
  • Run the program, see how it’s different from your prediction.
  • Add comments and write down the differences between your prediction and what actually happened.

Help! My code doesn’t work

Make sure that you check for the following things:

  • Square brackets for items in the list
  • Commas between each item in the list.
  • String items are in quotation marks
  • Range – the end value is NOT included in the output.
  • Search – not initialising counter OUTSIDE the loop.
  • Search – not incrementing counter INSIDE the loop.

Hints