Python readlines or file usage
Been really frustrated with this pro problem. everything I do doesnāt work, Iāve tried readlines like it suggests but the output format needs to be: Day 1, 8 pull ups and it returns [Day 1, 8 pull ups \n] so itās more of a hassle to remove that text. A little annoyed they suggest using readlines but wonāt accept the output text it formats to.. I guess Iām just annoyed how everything for pro problems has input in it but they donāt teach how to use input in most of the lessons, gets me discouraged that I canāt code. 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). file = open("/usercode/files/pull_ups.txt") n = int(input()) #your code goes here. My code below doesnāt make sense print(file.readlines(n)) file.close()