Error on Mission 353-10

https://app.dataquest.io/m/353/working-with-dates-and-times-in-python/10/summarizing-appointment-lengths

My original code was deemed incorrect:
‘’'for row in potus:
end_date = row[3]
end_date = dt.datetime.strptime(end_date, “%m/%d/%y %H:%M”)
row[3] = end_date

appt_lengths = {}

for row in potus:
start_date = row[2]
end_date = row[3]
length = end_date - start_date
if length not in appt_lengths:
appt_lengths[length] = 1
else:
appt_lengths[length] += 1

min_length = min(appt_lengths)
max_length = max(appt_lengths)’’’

However, it was considered correct when changed as follows:

‘’'for row in potus:
end_date = row[3]
end_date = dt.datetime.strptime(end_date, “%m/%d/%y %H:%M”)
row[3] = end_date
appt_lengths = {}

for row in potus:
start_date = row[2]
end_date = row[3]
length = end_date - start_date
if length not in appt_lengths:
appt_lengths[length] = 1
else:
appt_lengths[length] += 1

min_length = min(appt_lengths)
max_length = max(appt_lengths)’’’

This makes no sense to me. Why should the line placement of appt_lengths = {} change the answer?

2 Likes

Thanks for bringing this to our attention, @josephgriffis. I am able to replicate the error, the answer checker seems to really dislike having a line of spacing between the first loop and app_lengths. I’ll tag @Sahil so that the issue can get looked at.

1 Like

I still have the same error even by copy/paste the solution provide in the exercise

1 Like

Hi @josephgriffis, @fabrizio.anichini98,

Sorry about that! I can reproduce this issue on my end. Here is a workaround to mark the mission screen as completed:

Best,
Sahil

Hi Everyone!

Our content team has deployed a fix for this issue. It’s working fine on my end. Can you all check it again and let me know?

Thanks,
Sahil