Hi Parimal. There was a hint in the page about cleaning the weight column, and I suspect this may be the issue you’re having:
While it appears that the weight column may just need the kg characters removed from the end of each string, there is one special case - one of the values ends with kgs , so you’ll have to remove both kg and kgs characters.
Hi April, my code below removes the “kg” and “kgs” but I noticed that I get the same error when I submit the code written below. I get the correct answer when I replace “kgs” first. Do you know why this is?
When you remove ‘kg’ first, it will also remove the ‘kg’ from ‘kgs’, leaving behind just the ‘s’. Then when it then searches for ‘kgs’, it cannot be found because all that’s left is ‘s’. That’s why we want to remove the ‘kgs’ first, and then the ‘kg’, so that we avoid running into this problem.