WESTWORLD — CODE1161_wk07

Shelda Kristie
Design Computing
Published in
5 min readApr 21, 2017

Refactoring and recusion exercises, bludging, and open data project.

WEEK 5 EXERCISES — Refactoring and Recursion

New functions

.map(function, iterable, …)
If the iterable is True, it runs the function.

.split(string)
Splits the string into list of words.

.text
Reads the file.

type(variable)
Lets you set what type the variable is.

docstring
"""A multiple line message that describes the function."""

RECURSION

I found a really good link that helped me understand recursion (and kind of got the answer from).

This looks familiar.

EXERCISE 1

So, I took ages again on exercise 4, the wordy pyramid’s new functions.

I wonder what went wrong here.

Again, in an another sedated panic FML mode, Guy called me and pointed out the variable for list_of_words_with_lengths is only 1. ONE! It’s supposed to look like this

def list_of_words_with_lengths(lengths):

How did I get (start, end, stop)?

When I finished all the definitions, there was still linter errors that indicated something to do with docstring and pydocstyle? I had no idea what it was. Of course I started consulting with Mr. Google, but Mr. Google is bad at explaining, or at least I was way to tired of this whole thing and just gave up on it.

My version of Mr. Google.

WESTWORLD

Instead of doing the exercise, I spent a whole day binge watching Westworld. Through the whole show, they keep on mentioning loops, coding, iteration, and recursive. All I can think about was how bad I felt for binge watching instead of doing my assignment. On the other hand, this concept of coding, making AI and looking at the speech improvisation sequence makes me way more excited than I care to admit. The endless possibilities of the future. Although I hate anything that resembles human (I hate wax museums, I hate baby dolls).

“The uncanny valley.”

#nope

While on the topic of Westworld, can someone please confirm that loops in Sweetwater is daily, and outside of Sweetwater, the loops span until the hosts dies?

WEEK03_EXERCISES

So back to CODE1161. I did a quick check on my previous exercises since there are new things we installed (I’m not even sure what I installed) and they wanted docstrings on the codes (I think it was the PEP257). Guessed who found codes that did not have docstrings? ME! Obviously. So I did a quick docstring notes on the codes and found that my week 3 did not pass the test, it was totally fine (no linter errors). The test indicated that week3/exercise3.py was the problem.

Look at the left window (terminal). On the right is my week3/exercise3.py file.

As you can see, after choosing the appropriate lowerBound and upperBound, and guessing a number between the range, you can’t seem to guess the random number.

After hours and hours of frustration. I found the culprit over at week5/exercise1.py (which is where the definition for super _asker is from).

lowerBound < guessed < upperBound
vs.
lowerBound <= guessed <= upperBound

=_=

(╯°□°)╯︵ ┻━┻)

FML

OPEN DATA PROJECT

So previously, I was thinking of doing either one of these options:

1. Sands types in different beaches with … (have not think this through yet)
2. Different diseases in different suburbs against the green spaces.

But I think I might do the amount of child immunisation vs. number of sickness that are in the immunisation list. Why? Cause there are way too much people who does not immunise their children which cause the spread of virus faster to those who are allergic or can’t take a certain shot. (And just because I found the data on it)

A gif showing how fast a disease will spread between vaccinated and non-vaccinated people.

Data on child immunisation

At first glance, an average of 93% of immunisation. Good job. Not the best, but good enough.

Data breakdown:

  1. The data is separated into three age groups/cohort. 12 ≤ 15 months, 24 ≤ 27 months, and 60 ≤ 63 months.
  2. There are 8 diseases that the immunisation that the works againts.
  3. Not all 8 immunisations are done in each cohorts.

I can do this two ways, pick one disease and find the data on it, or find all 8 diseases.

So, I can’t find the data for the one above. So I’m changing it to tertiary education enrollment to the amount of immunisation.

I am assuming that people will start having kids when they are 29 years old.

Average age women are having babies.

And they enter tertiary education in 2006 (at 18 years old). And their citizenship is either Australian citizenship or an Australian permanent resident.

https://docs.education.gov.au/node/34251

The file is in excel though. Hope that is good enough.

--

--