Python 3, Part 5 (List Methods)

Tutorials about Python 3, the scripting language for Blender 2.5

Python 3, Part 5 (List Methods)

Postby irakrakow » Wed Mar 10, 2010 5:25 pm

Read the Script: http://www.youtube.com/watch?v=_HjITxJvLWQ

Read the Script: http://blender3dvideos.blogspot.com/2010/03/python-3-part-5-list-methods.html

In Part 4, we saw how to use slicing to work with parts of a string, list, or tuple, as well as how to insert, delete, and add to these types of variables. Python has a number of built in methods -- also called functions -- that can do these operations in a way that makes the code easier to read. Sometimes it's a bit hard to understand all those colons and square brackets, and it's easier to use words like append, remove, or insert, which are, indeed the names of methods associated with lists. We'll also see how these easy to understand methods can be used to build a simple stack (where the last element added is the first element retrieved) or queue (where the first element added is the first element retrieved). We'll also discover how to sort, count, and locate items in a list. Along the way, we'll learn about the autocomplete feature of Blender's Python console, a handy feature that documents available methods.
User avatar
irakrakow
Site Admin
 
Posts: 438
Joined: Fri Jan 22, 2010 9:01 pm

Return to Python 3

Who is online

Users browsing this forum: No registered users and 1 guest