Hi guys I’m trying to run my code on Gitpod and it keeps tellinG me there is a ‘’ TypeError: unsupported operand type(s) for /: ‘method’ and ‘method’ ‘’ when I try (country_rich_count/country_count). can someone please explain where I am going wrong.
you will need to show your code, the error is saying you are trying to divide a method by an other method
The is the boilerplate code that you start with.
You’ll need to share the code that you wrote. The code that’s generating the error.
I think this is the proper link this time
Here is the full error:
Traceback (most recent call last):
File "/workspace/boilerplate-demographic-data-analyzer/main.py", line 6, in <module>
demographic_data_analyzer.calculate_demographic_data()
File "/workspace/boilerplate-demographic-data-analyzer/demographic_data_analyzer.py", line 43, in calculate_demographic_data
highest_earning_country = ((country_rich_count / country_count) * 100)
TypeError: unsupported operand type(s) for /: 'method' and 'method'
Be sure and read more than just the first line of the failing message. The ability to read and comprehend error messages is a skill you’ll need to acquire as a developer. Ask questions on what you don’t understand.
Error points to line 43:
File "/workspace/boilerplate-demographic-data-analyzer/demographic_data_analyzer.py", line 43, in calculate_demographic_data
highest_earning_country = ((country_rich_count / country_count) * 100)
Try printing them to see what they are:
print("country_rich_count", type(country_rich_count), "country_count", (country_count))
print("country_rich_count", country_rich_count, "country_count", country_count)
highest_earning_country = ((country_rich_count / country_count) * 100)
This will help you understand why you aren’t able to divide them like this