Error in naIVE BIAS ASSIGNMENT

{moderator edit - solution code removed}

THIS CODE OUTPUT MATCHES RESULTS BUT FAILES TEST cases says dictionary wrong values.
while all other test cases which includes this function passes.
can anyone explain

You are making the most common mistake on this function. When you see a word, you are adding 1 to the positive or negative count. The point is to use the frequency of that word appearing in a positive or negative tweet. That’s what they mean by the comments that they gave you in the template code.

1 Like

It sounds like your dictionary’s structure or values don’t match the test case’s expectations. Double-check:

  1. Key Names: Ensure they match exactly (case-sensitive).
  2. Value Types: Verify types (e.g., int, float, list).
  3. Formatting: Round floats, sort lists, or trim strings if needed.
  4. Extra/Missing Keys: Remove unnecessary keys or add missing ones.

Print your output and compare it with the expected result to spot differences. Let me know if you need help debugging! :blush:

thanks a lot it worked