Question: I am writing a program on how to simulate a car for school. I have the majority of the program done however, I'm stumped on an error. 
I called these functions mid program:

```
find_gallons(total_distance, mpg)

find_total_cost (gallon, cost_per_gallon)

def find_gallons(total_distance, mpg):

    try:
       gallon = total_distance / mpg 
       print(gallon)
    except ZeroDivisionError:
        print("MPG is Zero!")

    return gallon

def find_total_cost(gallon, cost_per_gallon):

    total_cost = gallon * cost_per_gallon 

    return total_cost

```

The error is saying that find\_gallons and find\_total\_cost are not defined.

Answer: 
You are calling `find_gallons(total_distance, mpg)` and the other function before defining them.

```
def find_gallons(total_distance, mpg):

    try:
       gallon = total_distance / mpg 
       print(gallon)
    except ZeroDivisionError:
        print("MPG is Zero!")

    return gallon

def find_total_cost(gallon, cost_per_gallon):

    total_cost = gallon * cost_per_gallon 

    return total_cost

find_gallons(total_distance, mpg)
find_total_cost (gallon, cost_per_gallon) # Now calling after defining.

```
Your code formatting isn't completely clear, but you can't call a function in python before you've defined it. Move the calls below the definition.

```
def find_gallons(total_distance, mpg):
try:
   gallon = total_distance / mpg 
   print(gallon)
except ZeroDivisionError:
    print("MPG is Zero!")

return gallon
def find_total_cost(gallon, cost_per_gallon):

total_cost = gallon * cost_per_gallon 

return total_cost

find_gallons(total_distance, mpg)

find_total_cost (gallon, cost_per_gallon)

```