cont = file.read() Does it need argument? it is not working actually...... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

cont = file.read() Does it need argument? it is not working actually......

14th Jan 2021, 2:51 PM
Sourya Banerjee
Sourya Banerjee - avatar
4 Answers
+ 7
Kode Krasher in the latest version, we have to add some extra things to share lessons. Btw, it's for Android users. I don't know about iOS users 😉 https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2445/ https://www.sololearn.com/learn/Python/2446/
14th Jan 2021, 3:18 PM
Simba
Simba - avatar
+ 2
file.read() - - > read all contents of the file file.read(5) - - > read first 5 characters of the file. Why is it not working? Is this a challenge or i.e. an exercise?
14th Jan 2021, 2:55 PM
noteve
noteve - avatar
0
Open the file with correct path file = open("completepath.txt") Data = file.read()
14th Jan 2021, 2:58 PM
Ayush Kumar
Ayush Kumar - avatar
0
When i typed it, it is saying that read needs an argument even it is blank
14th Jan 2021, 2:58 PM
Sourya Banerjee
Sourya Banerjee - avatar