Create a program that takes n number as input and outputs the n-th days result (starting from 0). | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Create a program that takes n number as input and outputs the n-th days result (starting from 0).

Reading file in python 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 print(file.readline(n)) file.close()

5th Oct 2020, 12:08 PM
Arslan khan
Arslan khan - avatar
2 Answers
0
file=open("/usercode/files/pull_ups.txt") n=int(input()) list=file.readlines() print(list[n]) file.close()
18th May 2021, 8:20 AM
Kiruthika T
- 2
Please give me Answer of this Question
6th Oct 2020, 3:42 AM
Arslan khan
Arslan khan - avatar