Tuesday, March 29, 2011

Contiue onwards onto March 29th

This is me continuing on chapter 9 with list length:
List length program with example.

When it comes to list membership its very easy to understand. Like:
list membership 
From the program that ask that if pestilence was in horsemen, which it is outlined to be inside horsemen. Then it asks if debauchery was in horsemen which would obviously come out to false. To get this program to come out to be true you would have to say : 'debauchery' not in horsemen. This then comes out to being true.
list membership update with examples.
Onto to list operators:
list operator program
In list operators, its fairly easy to understand that withing the [] you can basically add anything to it. Basically all you have to do is just assign a variable to the numbers/ letters in the [], just with the letter you need [' '] with the word/ letters being insides the ' ' between them. But as you seen from my program I experiment with making the variables by trying to get them to equal the other variables outcomes. By for example:
g = f + c
then getting i to = g + a thus getting the following outcome:
['eye', 'i', 1, 2, 3, 4, 5, 6, 1, 2, 3]
Me assigning i to equal the outcomes of the other variables allowed me to get a even bigger outcome then just assigning i to equal just 2 of the other variables. I basically just wanted to make the outcome of this to be more complex.
List slices aren't to difficult ether, their just mixing slicing and list into one program:
list slice with original program and example.
Range is easy to understand:
range
I only had difficulties on range when it was coming to understand the negative step size:
examples
I don't get this because there is 3 numbers and I no that the start much be higher then the stop but I don't know what the middle number is suppose to mean.

1 comment:

  1. Excellent post! You are using linking to file examples very effectively. Nice work!

    ReplyDelete