Select the correct function#

Part 1#

Given that mylist of length {{ params_vars_length }} is defined as:

mylist = {{ params_vars_mylist }}

Which of the following code selects {{ params_vars_negate }} the {{ params_vars_section }} {{ params.vars.select_num }} elements of mylist?

Answer Section#

  • mylist[:3]

  • mylist[-3:]

  • mylist[4:7]

  • mylist[3:]

  • mylist[:-3]

  • mylist[16:16]

  • mylist[:4]

  • mylist[-4:]

  • mylist[3:8]

  • None of them are correct

Attribution#

Problem is licensed under the CC-BY-NC-SA 4.0 license.
The Creative Commons 4.0 license requiring attribution-BY, non-commercial-NC, and share-alike-SA license.