# Activity Solution for Python Lesson #2

Hopefully you were able to successfully complete the activity we posted last Friday!

Here is a possible solution:

```
= -5
num_1 = 8
num_2 = 7.5
num_3
= num_1 + num_2 + num_3
total = total / 3
average
print(average)
if average > 0:
print("The average is positive")
elif average < 0:
print("The average is negative")
else:
print("The average is zero")
```

## Explanation

The average of a set of numbers can be found by adding each of the numbers together and dividing the total by the amount of numbers.

Next, the first if statement checks whether the average is greater than zero. If `average > 0`

evaluates to `True`

, then that means the average *is* greater than zero, and it prints “The average is positive”.

Otherwise, it continues, checking whether the average is less than zero. If `average < 0`

evaluates to `True`

, then it will print “The average is negative”.

If it instead evaluates to `False`

, then there is only one other possibility left: The average is zero, which is neither positive nor negative. The code inside the `else`

block will be executed, printing “The answer is zero”.