#!/usr/bin/env python3

# INSTRUCTOR SAMPLE SOLUTION

# Test program for basic variable modification

# Question 1:
# Create two functions, foo and bar, which do the following:
# foo(x): Returns x plus 3 times the value of bar(x).
# bar(x): Returns (x - 2)^2.

def foo(x):
    return x + 3 * bar(x)

def bar(x):
    return (x - 2) * (x - 2)

# Question 2:
# Create variables i, j, and k, and assign foo(2), foo(4), and foo(6) respectively.

i = foo(2)
j = foo(4)
k = foo(6)

# Question 3:
# Modify a list of values [6, 3, 14, 18, 8, -5, 23, -14] with the foo function.

numbers = [6, 3, 14, 18, 8, -5, 23, -14]

for i in range(len(numbers))
    numbers[i] = foo(numbers[i])
