What does this mean


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
list and strings
-What does this mean-
1.
Assign to dog a slice of animals from index 3 up until but not including index 6.

Assign to frog a slice of animals from index 6 until the end of the string.

<In what way does your code behave incorrectly? Include ALL error messages.>

<What do you expect to happen instead?>

```python

Replace this line with your code.

<do not remove the three backticks above>

#2

We will need a link to the exercise to check the lesson and instructions, but from the question we may infer that you have an animals list, populated with seven or more items.

animals = ['parrot','rabbit','cat','dog','coyote','wolf','frog','lizard','snake']

Looks suspicious, and may be typo by the author. My interpretation of this is, to the end of the list.

A slice from index 3 up to but not including index 6,

animals[3:6]     # ['dog', 'coyote', 'wolf']

A slice from index 6 until the end of the list,

animals[6:]      # ['frog', 'lizard', 'snake']

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.