How do I count number of posts in a list?

Screen Link:

Your Code:

ask_posts = []
show_posts = []
other_posts = []

for row in hn:
    title = row[1]
    if title.lower().startswith('ask hn'):
    elif title.lower().startswith('show hn'):

Question 4: Check the number of posts in ask_posts, show_posts, and other_posts.

How do I check the numbers of a list?

Judging by your code alone (without regaining context on this guided project), you’re very close. You just need to inspect the length of each of the lists at the top to find your answer.

1 Like