Question 1 i Assignment 4 - help!

Hello All,

While I was trying to solve the Assignment I solved all the questions correctly, but the very first question after submission says it is wrong.
The question is:
Q1: How many countries does the dataframe contain?

My Answer was:
num_countries = countries_df.shape
print(‘There are {} countries in the dataset’.format(num_countries[0]))

Output: There are 210 countries in the dataset

After submission I got:
Q1: FAIL
The value of ‘num_countries’ is incorrect

Please help me here , what wrong am I doing and what is the right way to do

1 Like

Hey @mailmenaveed88
I don’t think that the ouput would be:
There are 210 countries in the dataset
because .shape() method return both the number of rows as well as columns

So your num_countries variable must be contaning a tuple and not an integer…
Just check value for that…and hopefully you will get it

Hope it helps…
Thank You

2 Likes