Thursday, August 7, 2014

Day 124

Python at CodeCademy. Worked on Python tutorial 6 of 14, Python Lists and Dictionaries: Slicing Lists and Strings! Worked on slicing a string exactly like a list.

The code used:
animals = "catdogfrog"
cat  = animals[:3]   # The first three characters of animals
dog  = animals[3:6]   # The fourth through sixth characters
frog = animals[6:]   # From the seventh character to the end

There was no interaction for this code:

No comments:

Post a Comment