Is the following syntax valid? file = open("filename.txt","r") print(file.read()) file.close() | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is the following syntax valid? file = open("filename.txt","r") print(file.read()) file.close()

10th Jul 2016, 2:47 AM
Essam Mohamed Mahmoud Ahmed
Essam Mohamed Mahmoud Ahmed - avatar
3 Answers
+ 1
yes. It's perfect. Are you facing some issues ?
10th Jul 2016, 3:30 AM
Ganesh G
Ganesh G - avatar
0
No, thanks.
10th Jul 2016, 6:03 AM
Essam Mohamed Mahmoud Ahmed
Essam Mohamed Mahmoud Ahmed - avatar
0
It is very right, Having trouble?
30th Jul 2016, 1:42 PM
Narek Tonoyan
Narek Tonoyan - avatar