18.11.2014 Views

Zelle - Chapter 11.pdf - CTools

Zelle - Chapter 11.pdf - CTools

Zelle - Chapter 11.pdf - CTools

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

What “is” a List Anyways?<br />

• A list is a special kind of variable<br />

• Regular variables - integer<br />

>>> i = 2<br />

• Contain some data<br />

• Contain some data and capabilities [3, 2, 1]<br />

• Smart variables - string, list<br />

>>> i = i + 1<br />

>>> x = [1, 2, 3]<br />

>>> print x<br />

[1, 2, 3]<br />

>>> x.reverse()<br />

>>> print x<br />

When we combine data + capabilities - we call this an “object”

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!