odds = [1, 3, 5, 7, 9, 11]
for num in odds:
    print(num)

"""
Explanation: Introduction to Python part VII (And a discussion of the covariance and the multivariate Gaussian)
Activity 1: Discussion of multiple random variables

What is the covariance / correlation between two random variables and how are they related?
What do we refer to when we discuss the "background" covariance matrix?  What special properties do we know about this matrix?
What is the anomaly matrix?  How is this related to the ensemble matrix?
What is the relationship between the anomaly matrix and the empirical covariance?  What is the relationship to the background covariance?
What is the implication of the multivariate central limit theorem for the ensemble mean?

Activity 2: Looping in Python
In the episode about visualizing data, we wrote Python code that plots values of interest from our first inflammation dataset (inflammation-01.csv), which revealed some suspicious features in it.

We have a dozen data sets right now, though, and more on the way. We want to create plots for all of our data sets with a single statement. To do that, we’ll have to teach the computer how to repeat things.
An example task that we might want to repeat is accessing numbers in a list, which we will do by printing each number on a line of its own.  This is done with the for loop with syntax as follows:
End of explanation
"""


for num in odds
    print(num)

for num in odds:
print(num)

for banana in odds:
    print(banana)

"""
Explanation: This follows the convention in Python where we can name an iterator for a list or an interable object as an arbitrary variable name, and sequence over the iterable in order:

Note that Python requires the use of the : to signify the end of the loop statement, and requires an indentation of four spaces to initiate the loop.  The next line that ends the space convention will automatically end the loop.
Exercise 1:
As a quick exercise, see if the following loops work:
End of explanation
"""


2**3

"""
Explanation: Exercise 2:
Python has a built-in function called range that generates a sequence of numbers. range can accept 1, 2, or 3 parameters.


If one parameter is given, range generates a sequence of that length, starting at zero and incrementing by 1. For example, range(3) produces the numbers 0, 1, 2.


If two parameters are given, range starts at the first and ends just before the second, incrementing by one. For example, range(2, 5) produces 2, 3, 4.


If range is given 3 parameters, it starts at the first one, ends just before the second one, and increments by the third one. For example, range(3, 10, 2) produces 3, 5, 7, 9.


Using range, write a loop that uses range to print the first 3 natural numbers:
Exercise 3:
Given the following loop:
word = 'oxygen'
for char in word:
    print(char)
How many times is the body of the loop executed?
Exercise 4:
Exponentiation is built into Python:
End of explanation
"""


for idx, val in enumerate(a_list):
    # Do something using idx and val

"""
Explanation: Write a loop that calculates the same result as 2 ** 3 using multiplication (and without exponentiation).
Exercise 5:
The built-in function enumerate takes a sequence (e.g. a list) and generates a new sequence of the same length. Each element of the new sequence is a pair composed of the index (0, 1, 2,…) and the value from the original sequence:
End of explanation
"""


x = 5
coefs = [2, 4, 3]
y = coefs[0] * x**0 + coefs[1] * x**1 + coefs[2] * x**2
print(y)

"""
Explanation: The code above loops through a_list, assigning the index to idx and the value to val.
Suppose you have encoded a polynomial as a list of coefficients in the following way: the first element is the constant term, the second element is the coefficient of the linear term, the third is the coefficient of the quadratic term, etc.
End of explanation
"""


