6.slicing and strings


#1



https://www.codecademy.com/en/courses/python-beginner-en-pwmb1/1/3?curriculum_id=4f89dab3d788890003000096


i dont understand the message i mean question


please help i dont understand question
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.


Replace this line with your code. 
animals = "catdogfrog"
cat  = animals[:3]   # The first three characters of animals
print cat
dog = animal[4:]      # The fourth through sixth character
print dog
frog = animal[6:11]      # From the seventh character to the end
print frog


#2

@scientist1995,

0 1 2 3 4 5 6 7 8 9   <==index-count
c a t d o g f r o g
1 2 3 4 5 6 7 8 9 1   <==Human-count
                  0

==========================================================

cat

0 1 2 3 4 5 6 7 8 9   <==index-count
c a t d o g f r o g
0 1 2 3    <==slice [0:3] or in-short [:3]

==========================================================

dog

0 1 2 3 4 5 6 7 8 9   <==index-count
c a t d o g f r o g
      3 4 5 6         <==slice [3:6]

==========================================================

frog

0 1 2 3 4 5 6 7 8 9   <==index-count
c a t d o g f r o g
            6 7 8 9   <==slice [6:10] or in-short [6:]

==========================================================

If you use the slicing
internally it will be translated to

capture from the =begin-of-slice= until =less-than End-of-Slice= using INDEX-count

#3

thanks sir i will try this out soon and let you know wheter it works or not


#4

thanks problem solved

animals = "catdogfrog"
cat = animals[:3]
print cat
dog = animals[3:6]
print dog
frog = animals[6:10]
print frog

following is code