Need help understanding this
Hello there, so I've just solved this question but i got it wrong the first time so isit okay if u guys help me explain why my first code is wrong and why the second one works. Tom has done pull ups every day and recorded his results. He recorded each day's results in a new line, so that each line represents each day he has done pull ups. Create a program that takes n number as input and outputs the n-th days result (starting from 0). Sample Input 4 Sample Output Day 4, 9 pull ups #First code: file = open("/usercode/files/pull_ups.txt") n = int(input()) #your code goes here print(file.readlines(n)) file.close() #second code: file = open("/usercode/files/pull_ups.txt") n = int(input()) #your code goes here print(file.readlines()[n]) file.close()