Act fast, special offers end soon! Up to $294 is savings when you get Premium today.
Get offer codes

Instructions Unclear Here (Python > Indexing > 2nd Page)

Instruction Given:

Assign the fourth element from the list row_1 to a variable named ratings_1 . Don’t forget that the indexing starts at 0 .

Correct Understanding:
row_1 = [‘Facebook’, 0.0, ‘USD’, 2974676, 3.5]
ratings_1 = row_1[4]

But when this code is executed, the system is giving error as it is expecting a different value.
When I execute the below code, it is accepting.
ratings_1 = row_1[3] # index 3 == 4th element of row == review count (not ratings)

You need to correct: The code checking mechanism. It is checking for index 3 and not for index 4. You can try it yourself. When you read the error it states that It is expecting an INT, not a FLOAT. Like that you can find many clues which lead to the conclusion that the code checks here are wrong.

Please fix it. It will surely confuse many people especially new to programming.

3 Likes

True that! I’ve encountered the same problem as well
To extract rating the code should be row_1[4] where 4 is the index of rating value but it is throwing an error.( as it is expecting a different value.)
However, When I execute the code with index 3, it is accepting.
ratings_1 = row_1[3] # index 3 == 4th element of row == review count (not ratings)

I think we should modify this context for this example in order to avoid confusion.
Below is the link for your quick reference :slight_smile:
Modification required

Thanks for looking into this.

Thanks! I also had a similar issue with this! I agree that modifying the context should be done for this example to avoid confusion.

2 Likes

Hello guys.
If I understood your question correctly you guys are wrong about this.

When you say:

Correct Understanding:
row_1 = [‘Facebook’, 0.0, ‘USD’, 2974676, 3.5]
ratings_1 = row_1[4]

I’m sorry, but this is not a correct understanding.

The instruction tells you to assign the FOURTH element, not the element with index number 4. The fourth element is indexed by the number 3, as the instruction itself says "Don’t forget that the indexing starts at 0".

When you assing the index 4 in this row, you are assigning the value 3.5, the fifth element, which is a float, but the instruction asks for the fourth element, the value 2974676, which in an INT. That’s why the error states that it is expecting an INT, not a FLOAT.

You also need to pay attetion to what the the values in the dataset mean. In this case:

  • The text “Facebook” as a string
  • The price 0.0 as a float
  • The text “USD” as a string
  • The rating count 2,974,676 as an integer
  • The user rating 3.5 as a float

The last two values are related to the ratings, but the first is the count of how many evaluations the app received and the second one is the rating itself, that is why in this screen you are asked to assign the fourth element to the ratings_1 variable (ratingS, plural, cause it is the amount of ratings) and in the next screen you have to assign the last element to the rating_1 (rating, singular).

The instructions are not, in anyway, unclear.

7 Likes

The beauty of effective teaching is to avoid confusion either small or big.

When you allow confusion and then ask us to be particular about variable spellings like singular(rating) and plural(ratings). That won’t work. That style of argument leads to a verdict that “I am not listening to the learners’ point of view”.

Confusion Traps:

  1. The entire section is teaching about the 5-star rating (index 4) variable and nowhere about the number of ratings. It is easy to think that problem is also about the 5-star rating variable (index 4). The student would not imagine that you jumped from 5-star rating to rating_counts (index 3).
  2. Variable names are very close to similar meaning (ratings vs rating).

Suggestings to avoid confusion:
Please change the variable names in the exercise to meaning full ones. Use count_of_ratings instead of ratings. This will bring student attention.
OR
Please change the question to ask for an average of 5-star ratings(index 4) and change the code checker accordingly.

Expecting a new learner to pay attention to the spelling of variables is unrealistic.

Please notice that in your first message you never said anything about the variable names at all. That was not the issue for you. Actually the issue for you, and I quote, was:

You need to correct: The code checking mechanism. It is checking for index 3 and not for index 4.

And yes, it was cheking for the index number 3, which represents the FOURTH element mentioned in the instruction. It is correct.

And now the varaible names is all you talk about in your second message.

What a I tried to do with these names was to point out that they were two different variables. But the point here is that the instruction does not rely on the variable names whatsoever. So, you do not have to notice the difference to answer the question.You only need to follow the instruction:

Assign the fourth element from the list row_1 to a variable named ratings_1 . Don’t forget that the indexing starts at 0 .

This instruction is as clear as it could be. Note that it does not tell you to assign the “count of ratings” or anything like that. It explicitly tells you to assign the FOURTH element. And it reminds you that the indexing starts at 0.

Also, if you click in the Get a hint button you’ll get this:

  • The indexing starts at 0 , so the third element in a list corresponds to index number 2 .

And if you click to see the answer, you will see this:

ratings_1 = row_1[3]

I mean, it is all over you! There’s no confusion at all.

And do not get me wrong here, I have no problem with the fact that you did not understand the concepts or the instructions or anything. There’s no such thing as a stupid question. If you do no get it, you are more than correct to ask. Everybody goes through this. I still do.

The problem for me, however, is that you did not ask. You just communicated that the plataform was wrong. And it is not. You were too busy assuming that you were correct that you did not notice that you weren’t.

Since you mentioned the beauty of teaching, I’d say that the beauty of learning is to admit that you do not know and try do get better. When you classify as “Correct Understanding” a clearly wrong understanding despite the fact that the actual correct understanding is all over you, you do not seem to admit that you are the one who do not know, not Dataquest. I mean, you are literally looking at the answer and saying it is wrong. Well, it is not.

And you even said that when you executed ratings_1 = row_1[3] , it was accepted. Well, of course it was.

1 Like

Let me make it simple. It is not just me, there are others who mentioned that they too are confused.

Therefore, I suggested changes to avoid confusion.

I don’t know whether you are a student or an employee of dataquest. My message is to the person who is incharge of this page for corrections or modifications.

Let dataquest team decide whether they will correct each and every confused student or will they avoid instructions which may lead to confusion.

My purpose in creating this thread is to guide fellow new students who are stuck at this page due to confusion. And based on their replies, I believe the purpose fulfilled.

I am only a student.

I am letting the dataquest team decide. I’m not stopping them, I’m just giving my opinion as this is a public post.

And I stand by what I said: the instruction is as clear as it could be, it does not rely on the variable names, there’s no confusion at all, people are stuck because the indexing starts at 0, which is normal, and you guys managed to find the right answer and then disregard it.

I would definitely agree. The phrasing in this question leads the newbie coder into using [4] instead of [3]. This would be a HUMAN syntax error. There should be maybe even slight alteration in the phrasing to assist us newer coders. I know I made the mistake. Also, you’re averaging “ratings_” which would lead me to believe with deductive reasoning that we are looking for [4] and not ACTUALLY [3] in this particular problem. If was being asked to average the NUMBER of ratings like avg_num_ratings1 = row_[3] because we are essentially being asked to average out the number of ALL ratings and not average out the ratings (i.e. 3.5, 4.0 etc…)

Basically, just some minor changing in the phraseology here would probably assist learners a lot. Just my two cents.

How does do instruction below leads anyone to assign row[4] instead of row[3]?

  1. Assign the fourth element from the list row_1 to a variable named ratings_1 . Don’t forget that the indexing starts at 0 .

I mean, it even reminds the user that indexing starts at 0.

I’m going to repeat what I said before in this topic: the question does not rely on the variable names at all. You do not have to notice the difference between ratings, rating, rating_count, number_ratings, average_rating, or anything like that to answer the question. It explicitly tells you to assign the FOURTH element. And as I said, it even reminds you that the indexing starts at 0.

1 Like

Otavios.s,

As a community moderator your reply was neither constructive nor helpful. I was giving my opinion as many others have made the same mistake. If multiple people are reading this incorrectly then there must be an issue with the question.

Kindly,

The indexing starting from 0 is one of the basic knowledge in programming. The question is probably asked like this to make the students learn and remember “the hard way” :blush: For the students who got confused, I can just say that you will find this language very very often, with just a little practice it will come natural to you that the first means [0] :slight_smile: So don’t be disappointed, as I said I support Dataquest in using the “proper” language that it is used in this field.
PS. I am only a student and just a little more than beginner :blush:
PPS. @hannahsharma1989 welcome to the community! :tada:

4 Likes

I don’t see the problem with my answer. I just replied to your post explaining why the question is not confusing.

And I kindly ask you again: how does the instruction below leads anyone to assign row[4] instead of row[3]? I just can’t see it. Can you please show me which part of the instruction creates the confusion?

  1. Assign the fourth element from the list row_1 to a variable named ratings_1 . Don’t forget that the indexing starts at 0 .
2 Likes

The instructions are not clear since the forth element to assign is [4] not [3], expected by the program.
The explanation from the team member left me more confused.

The fourth element is row_1[3] as expected by the answer-checking mechanism.

1 Like

You are right!! I was in the same situation as the other guys, thanks for the correction…

1 Like

Finally someone to agree with me on this obvious subject :joy::joy::joy:

Haha well… after read it and read it finally I understood what you were saying, but it took some time.
Thanks bud!!

1 Like