ValueError: invalid literal for int() with base 10: ‘h’

Hello Nguyen, I am having similar problem. How did you sort it out.

total_ask_comments = 0
for row in ask_posts:

total_ask_comments +=  int(row[4])

avg_ask_comment = total_ask_comments / len(ask_posts)

ValueErrorTraceback (most recent call last)
in ()
2 for row in ask_posts:
3
----> 4 total_ask_comments += int(row[4])
5
6 avg_ask_comment = total_ask_comments / len(ask_posts)

ValueError: invalid literal for int() with base 10: ‘h’

1 Like

Hi @khalidhann,

Welcome to the community! We would be happy to help you with it. To help you better, I would recommend you to upload your notebook (.ipynb) file.

Best,
Sahil

Hi @khalidhann, here is the solution, use this link

1 Like