---
# System prepended metadata

title: Week II

---

# Week II
## Python and Variables
Consider the variable **to be** the container of a **value**.
### Types of Variables
Or the **size of a variable**.
Lets consider the following:
- 0
- 4.5
- H
- Hello
- True / False

## Solving Mars weight
- Two outputs written out
- One value calculated
- One value as an input

## Solving 8-ball
### One question --- One Answer
- Print a prompt
- Take a question -----
    - Discard the input
- Return an answer AT RANDOM
    - We need a random variable
    - A selection mechanism

### Multiple Rolls with the 8 ball
- Refactor into a function
- Call function until ... --> `while` since we have an end state
    - Approx with a for loop or use an infinite while
```python=
while True:
    roll_8ball()
```

- Use the user input as a control variable for the `while` loop

```python=
question = input("Ask a yes no question: ")
while question == "NO":
    ans_one_ques()
    question = input("Ask a yes no question:")
```