Results for “negative slice”

2 results

  1. Challenge

    Last five readings

    Show only the five most recent CO2 readings with the slice [-5:], as a dashboard does, then add a new reading and print how much the level changed across the window.

    Write the code Easy 2 stages lists slicing negative slice append
  2. Challenge

    Off-by-one slice

    A slice meant to take the number from the container tag CG-0042 gives -004. Predict it, work out where indexes start and where a slice ends, fix it, then slice a sample label yourself.

    Fix the code Easy 3 stages strings slicing indexing off-by-one