- 2
Fill in the blanks to try to open and read from a file.Print an error message in case of an exception.
try: _____ open("test.txt") as __ : print(f.read()) ____________ print(error)
22 Respostas
+ 17
with open("test.txt") as f :
print(f.read())
except :
print(error)
+ 4
file =open ("filename.txt", "r")
str = file.read()
print(len(str))
file.close()
+ 3
try:
with open("test.txt") as f:
print(f.read())
except:
print("Error")
+ 2
try:
with
open("test.txt") as
f
:
print(f.read())
except:
print("Error")
+ 2
https://youtu.be/Tg4Du8eUFw8
this is youtub channel link in which full tutorial video
+ 2
1. with
2. f
3. except:
is true answer
+ 1
with/f/except
+ 1
with open("test.txt") as f :
print(f.read())
except :
print(error)
follow on insta = gyan.22
+ 1
Fill in the blanks to create a valid with statement, reading the contents of the file.
with
open("test.txt")
as
f:
print(f.
read
())
+ 1
0
Actually READ the tutorial before that section of the python quiz.
0
the three answers are:
'with', 'as', and 'read'
0
the answers are:
'with', 'as', and 'except:'
0
7
0
try:
with
open("test.txt") as
f
:
print(f.read())
except:
print("Error")
0
1. open
2. readlines
3. 1
0
with open('admin panel.txt','a') as s:
plzz tell corrct line plzz
0
FILE* fptr = fopen("test", "r");
if (feof(fptr))
{
printf("End of file reached").
exit (42);
}
0
If the file test.txt has 7 lines of content, what will the following expression return? len(open("test.txt").readlines())
0
HEY guys hows your learning going on