Totem.py
and write functions in that module. The code
you write must conform to the totem standards below.
hair_part
below:
15*k + (k-1)
where k is the number
of lines represented by the string. A one-line string will be exactly
15-characters, a two-line string will be two lines of 15 separated by
one new line character so it's length will be 31 = 15*2 +
(2-1)
characters
Some of the characters in each line can be spaces, but each must have length fifteen as a string (again, multi-line strings are fine).
totem
and the other should be named
randompole
. The first will print the same totem-pole each
time it is called. The totem-pole must consist of at least three
different "heads".
The second function, randompole
, should create different
poles each time it is called based on using the Python random
module.
The main idea in these standards is that someone's eye_ball function and a different person's chin_chin function could be used together. If your faces are lined up, your code is fine. If your face parts can be used with someone else's parts, that's even better. So try to adhere to the standards, but that's not the principle part of this assignment.
123456789012345 |||||||||||| | | _| |_ \ () () / \_ _/ | oo | | | | -- | | | +------+ 123456789012345 ~~~~~~~~~~~~~ \ --- --- / _\ O O /_ (_ _) ] ( ) [ | | \ / \\\\\//// \\\//// \\/// \//
totem
that results in generating three totem heads.
main
Python idiom we've seen to run
both totem
and randompole
when the
program is run, e.g., from Eclipse:
hairParted
that conforms to the totem standards.
def hairParted(): return " "*5 + r"\\\\\\\\//"Note that 5 spaces are concatenated to 10 characters in a raw string.