+ 3
Python, Reading files, Test what you know
HEY GUYS, IM STUCK ON THIS CHALLENGE. IF SOMEONE CAN SOLVE THIS FOR ME SO I CAN SEE WHERE IM FALLING SHORT. THANKS IN ADVANCE. https://sololearn.com/coach/179/?ref=app MY CURRENT CODE: file = open("/usercode/files/pull_ups.txt") n = int(input()) print(file.readlines(n)) file.close()
7 Answers
+ 7
file = open("/usercode/files/pull_ups.txt")
n = int(input())
list=file.readlines()
print(list[n])
file.close()
+ 3
Coder Kitten â
+ 3
print(file.readlines(n)) -----> print(file.readlines()[n])
+ 2
What is the challenge? đ
It is not available for non-pros đą
+ 1
im a beginner with this, iv been trying for a while now to solve this đ
challenge:
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).
0
thanks
- 5
what are you trying to do? and no, nobody will just solve it for you.