This blog contains the scripts for my Blender 3D YouTube videos. They're published as follows:
Buy The Blender 3D Cookbook as a book!
Buy the Blender 3D Cookbook for your iPad!
Buy the Blender 3D Cookbook for your Kindle!
Wednesday, March 10, 2010
Python 3, Part 4 (Slicing)
In Part 3, we were introduced to lists, which lets us work with more than one variable at once. We also saw how to reference parts of the list, say the 3rd element in the list x as x[2] (since we start numbering from 0), using the [] operator, and how to use negative numbers to reference list elements from the end. In this tutorial, we will go into more detail about how to get parts of strings and lists, by use of slicing. Slicing also uses the square brackets, but in a new and different way.
Labels:
blender 2.5,
programming,
python 3,
scripts,
slicing,
tutorial