Last Time (§§ 4,5)
There are three sequence types.
- lists: a mutable heterogeneous sequence type
- tuples: an immutable heterogeneous sequence type
- strings: an immutable sequence of characters
We also learned about the Python documentation and the builtin functions and types pages.
§§ 11-13 discuss pooling, aliasing and the "pointing relationship" that has been a theme in class. Reading these will clarify a lot for you.
Truthy, Falsy and None
An object is truthy if when it is cast to a boolean,
the result is True
.
An object is falsy if when it is cast to a boolean,
the result is True
.
None
is Python's graveyard type.
None
is falsy.
Comments
print
and its Many Powers (§ 8)
# what does this do?
# this is the comment token
# python ignores everything from it to the end of the line.
print("Hello")
print(1,2,3, True, "cows", [1,2,3])
print(1,2,3, True, "cows", [1,2,3], sep = " * ")
print(1,2,3, True, "cows", [1,2,3], sep = "|")
print(1,2,3, True, "cows", [1,2,3], end = "FOO")
print("a", end="")
print("b", end="")
print("a", end="")
print("c", end="")
print("d", end="")
The Symbol Table and Expressions (§ 9)
When you create a variable you write on the symbol table.
* ** *** **** ***** ******
* * * * * * * * * * * * * * * * * * * * * * * * *