{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
{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.
It sounds like your dictionary’s structure or values don’t match the test case’s expectations. Double-check:
int
, float
, list
).Print your output and compare it with the expected result to spot differences. Let me know if you need help debugging!
thanks a lot it worked