When you calculate the avg_rating, you are dividing by a wrong value of len(apps_data). Instead, you have to find the length of the apps_data dataset excluding the first row, i.e. the head of the dataframe:
avg_rating = rating_sum / len(apps_data[1:])
In this case, the denominator will be equal to the number of values for which you want to calculate the average, so you will get the correct answer.
and didn’t work, eventhough the exercise suggested answer says:
You can easily get the number of ratings by using len(apps_data). But the first row of apps_data contains the column names, so we’ll need to exclude it — this means that we need to use either len(apps_data[1:]), or len(apps_data) - 1.