# Tutor profile: Jason J.

## Questions

### Subject: Python Programming

What is the difference between global and local variables?

Variables can hold different values depending on where they are located within a Python script. Variables that are declared and used within a function are called local variables. On the other hand, variables that are declared and used outside of a function are called global variables. If a variable with the same name is used both outsides and inside of a function, this variable will be treated by Python as two different variables. You can tell Python to treat the variable outside of the function and the variable inside of the function as the same variable by using the $$ global $$ keyword within your function!

### Subject: Statistics

Given some data, how can I calculate the mean?

The mean is simply the average of all the data points you were given. Let's take for example the following numbers: 47, 45, 34. First let's take a look at the formula for mean: $$ Mean = \sum{X}/N $$. The summation tells us that we should add all of our data points $$ \sum{X} = 47 + 45 + 34 = 126 $$. The $$ N $$ symbol represents the number of data points that we were given. Since we have 3 data points, then $$ N = 3 $$. Putting all this together, we get a mean of: $$ Mean = 126/3 = 42$$

### Subject: Algebra

What is the correct approach to solving an equation, with multiple types of operations, for a specific variable such as $$X$$?

Solving an equation for a specific variable is simple if you follow a few simple rules. The objective of solving an equation for a specific variable is isolating that variable on one side of the equation. Let's take for example the following equation: $$ 4x + 78 = 3x + 2 $$. The objective is solving for $$x$$ so we can start combining all $$ x $$ variables. We can do this by moving all $$x$$ variables to the same side. This is done by subtracting $$ 3x $$ to the left-hand side. This gives us the following equation $$ 4x - 3x + 78 = 2 $$. Next, we can simplify the equation: $$ x + 78 = 2 $$. Finally, we can move the $$ 78 $$ to the right-hand side by also subtracting it on both sides of the equation. $$ x = 2 - 78 $$. We can now simplify this equation and get the following answer: $$ x = -76 $$