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
Sahil
March 25, 2020, 11:16am
#5
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:
Sometimes, due to some technical issues on our platform, our answer checking system does not work as intended. Fortunately, we have a workaround to mark a mission screen as complete.
To mark the screen as complete, please paste the exact copy of the Dataquest solution and run that code, this will mark the screen as complete. If it doesn’t work, continue with the mission and let us know once you finished it. We will mark the mission as complete from our end.
Note: Whenever our system finds you…
Best,
Sahil
Sahil
March 30, 2020, 5:10pm
#7
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