readlines() Py | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

readlines() Py

Hi there! please tell me why the file.readlines() method only outputs [] to the console. Thanks

18th Aug 2022, 9:32 PM
Artem Kodolov
Artem Kodolov - avatar
4 Answers
+ 2
file is empty!!! ?
18th Aug 2022, 9:48 PM
Jayakrishna 🇮🇳
0
Sorry, no. Thats .txt file, with some text on multiple lines of strings. And console print output “[ ]” 🥺
18th Aug 2022, 10:33 PM
Artem Kodolov
Artem Kodolov - avatar
0
file.read output text inside , but readlines NO
18th Aug 2022, 10:34 PM
Artem Kodolov
Artem Kodolov - avatar
0
🤔can you show the code?
19th Aug 2022, 8:29 AM
Jayakrishna 🇮🇳