Python Forum

Full Version: unusual error message
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is my code:

### population density
def population_density (population,land_area):
    population = int('10')
    land_area = 1
    population_density = (Population/land_area)
    return
print(population_density)
Error message:
Error:
<function population_density at 0x03E69348>
Any help will be appreciated
VISHU
In the future, post all code, the [b]entire[/] error code and outputs between the proper code tags.

This line:
    population_density = (Population/land_area)
You capitalized "population".
Also, you don't need to say this:
    population = int('10')
when
population = 10
Trying to stay as close to your original code:
def population_density():
     population = 10
     land_area = 1
     pop_density = population/land_area
     return pop_density

density = population_density()
print(density)