+ 6
Here's the working code. Don't need that "for i" loop at all. Just use the input variable (n) as the index into the lines.
print(new_list[n])
+ 2
You have: print(newList[i]). Should be: print(new_list[i])
+ 2
Hi..!
the following code works, here the thing is we have to use "readline" or "readlines"
#####
file = open("/usercode/files/pull_ups.txt")
n = int(input())
#your code goes here
for i in range(n):
file.readline()
print(file.readline())
file.close()
#######
+ 1
Jerry Hobby thank you very much your code helped me too. 🌟🌟🌟🌟🌟
0
please can you sharare the practice problem to solve ?
0
my solution:
file = open("/usercode/files/pull_ups.txt")
n = int(input())
cont =file.readlines()
print(cont[n])#your code goes here
file.close()
0
my solution:
file = open("/usercode/files/pull_ups.txt")
n = int(input())
print(file.readlines()[n])
file.close()