My Code:
import datetime as dt
# Write your solution below
f = open('session_log.csv')
reader = csv.reader(f)
rows = list(reader)[1:]
time_list = []
max_time = None
latest_session_user_id = None
for row in rows:
row = [int(x) for x in row]
start = dt.datetime(row[1],row[2],row[3],row[4],row[5])
time_list.append(start)
if start == max(time_list):
latest_session_user_id = row[0]
max_time = start
latest_start_str = max_time.strftime("%Y/%m/%d %H:%M")
What I expected to happen:
Match the correct answer
What actually happened:
Error: latest_session_user_id is greater than what we expected.
My code says the latest date is “‘2020/01/01 23:50’”
DQ’s answer says the latest date is ‘2020/01/02 09:37’
I downloaded the csv and the latest date as per DQ is missing in that file from the exercise.