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