Hey Everyone! Need some help with this. Sorry this might be stupid for you guys but I was trying hard to figure this out.
This is my code.
total_ask_comments = 0
for comment in ask_posts:
num_comment = int(comment)
total_ask_commtents += num_comment
avg_ask_comments = total_ask_comments / len(ask_posts)
this is the error
“ZeroDivisionError: division by zero”
So now, when I review the previous cell and run this code:
for row in hn:
title = row
if title.lower().startswith(‘ask hn’):
elif title.lower().startswith(‘show hn’):
the ask_posts is .
What did I miss here? Or what was wrong in my code?