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()