Screen Link:
import datetime as dt
result_list = []
for post in ask_posts:
result_list.append([post[6], int(post[4])])
counts_by_hour = {}
comments_by_hour = {}
for each_row in result_list:
date = each_row[0]
hour = dt.datetime.strptime(date, "%m/%d/%Y %H:%M").strftime("%H")
if hour not in counts_by_hour:
counts_by_hour[hour] = 1
comments_by_hour[hour] = row[1]
else:
counts_by_hour[hour] += 1
comments_by_hour[hour] += row[1]
Replace this line with your code
What I expected to happen:
I expect an output after running my code. It should have displayed the number of ask posts created per hour
What actually happened:
nothing happened, it just inserted another line to type code
Replace this line with the output/error
```At first it was keyerror 9, I made some corrections but there was no output after my corrections
<!--Enter other details below: -->