What i do wrong ?
i have been struggling with this issue for a looooong period of time file = open("/storage/emulated/0/download/pull_ups.txt") what is wrong in this code ?why this pass is not correct ?I check this way several times but nothing work ...
What is it supposed to do? What are you trying to achieve? Please link your complete code. If it is a sololearn task, please mention course name and task number.
For the task use this link only.. file = open("/usercode/files/pull_ups.txt") #Even from pc, if you try it in Sololearn web version, your link won't work. So that's why, The link is already given in the task in description. Don't change it. It access server file. Your link access your mobile storage, which is not supported by SL. And task asks to print read text of nth line of file I think. Add that statement before file.close() Hope it helps...
The files is on sololearn's server, not on your local device. Open the file. Read the line from the file. Close the file. You need to get integer input to read the specific line in the file.
The link seems to be a local storage of mobile. It works fine if you try it in your pc Or laptop from system IDEs. But from sololearn, it won't work as sololearn don't access your local storage.
solo learn will most likely work with files on its servers not your local storage #Try using any of these this instead file = open("/usercode/files/pull_ups.txt") #To create files on solo Learn server and then write and then close it. file = open("pull_ups.txt") #Simply to create file for your usage then dont forget to close the file #use this instead to avoid mistake of forgetting to close file with open("/usercode/files/pull_ups.txt") as file: #by using this format you do not need to close the file n = int(input() nthday = file.readlines() //nthday contails a list of all lines from the f print(nthday[n])
Dear u r suppose to be some school teacher. Ur answer need .. in the open() before ur path.
i try from my PC
wait a minute pls
file = open("C:\Users\Expert PC\AppData\Local\Programs\Opera GX\pull_ups.txt") n = int(input()) #ваш код file.close() That code from pc and this is task 47.2 in python course
i cant understand what is wrong
how can i add correct pass to file ?console say that this pass is not correct
or other question,how can i add file on server
Probably you didn't close the file by using ; file.close()
Guys messy messages, why not to put code on playground and share?
Глеб Подлесный don't use absolute/full path for the file location. If file is located in the same folder as your python file just use: ℹ️f = open("test.txt")
How do I generate a list with <N> unique elements randomly selected from another (already existing) list?
Given three integer matrices A(m*n),B(m*n) and C(m*n) . Print the one with more zero elements. beside code
I'm coding this for hours & can't make the value of the 5 random numbers round off to 2 decimal places like in the examples
Overloading + operator
( NEED HELP ) Halloween candy