#Checking for number of comments in ask_posts
total_ask_comments = 0
for posts in ask_posts:
num_comments = int(posts[4])
total_ask_comments += num_comments
avg_ask_comments = sum(total_ask_comments)/len(ask_posts)
print(avg_ask_comments)
When I run this code it pop up an error
TypeError “int” not iterable.
When I print(total_ask_comments)
It print an output.
Hello @onyidojohn, could you post a link to the mission?
Also, it is important to properly format your code so it’s easier for people to understand it. You can see how to do this in the Technical Question Guidelines.
Asking a good question increases your chances of receiving a fast, accurate answer.