Skip to the content.

Code 401 Class 06 Reading Notes

How To use Random Module

This will solve ‘What’s for Dinner’ at our house, and likely a lot of other houses too

By running Randint, I would gather up a handful dinner ideas that we typically eat through the week (really, we at most the same 5 things every week). Randint will accept two parameters: a lowest and highest number. First value shall be less than the second.

Using the choice function can, we can input basic dinner ideas.

import random

myDinner = ['chicken breast', 'turkey tacos', 'chicken and broccoli', 'chicken and pesto sauce', 'pizza']

print (random.choice(myDinner))

Perfection

I know that using Randrange would be great function for complicating/making easier(?) board game sessions.

import random

for i in range(3):
    print (random.randrange(0, 101, 5))

## output:
30
0
25

What is Risk Analysis

I am familiar with Risk Analysis in my previous role as a Project Manager

Most of the items are related:

I remember a specific instance of using a new way of pulling wire that is supposedly increasing productivity by 25% per pull. We would then ask for a break down from the field of steps/time that we were actually saving and then put it against customer budget over the length of the project lifeline.

Since this was an unorthodox method, we had to also put it against any possible seen and unforeseen failures that may occur. What do those impacts look like? Is this enough information to buy this new method? No, move on. Yes, lets buy enough for a floor and see how the real productivity numbers add up.


Test Coverage

STATEMENT WHY THIS TOPIC MATTERS AS IT RELATES TO WHAT YOU ARE STUDYING IN THIS MODULE

SUMMARIZE AND EXPLAIN TOPIC VIA AN ANALOGY FROM YOUR PREVIOUS WORK OR HOME EXPERIENCE


Big O Notation

Big O with my toddler

O - I wake up first thing in the morning and have my coffee.

O(n) - toddler wakes up and now I am making breakfast for said toddler, and his stuffed animal “Elsa”(not the frozen character, a cute dragon).

O(n^2) - Now I am making “Elsa” an imaginary dragon plate.

Things I want to know more about

That Big O! Each time I get a resource through here I am learning something new!

<—BACK