Agree, D is correct:
try:
f = open("linije","w")
print(1, end="")
s = f.readline()
print(2, end="")
except IOError as error:
print(3, end="")
else:
f.close()
print(4,end="")
The IOError exception is raised by the line s = f.readline() because the file was opened in write mode ('w'), and readline() tries to read from a file opened in write mode, which is not allowed.
D
s = f.readline() --> io.UnsupportedOperation: not readable
upvoted 2 times
...
This section is not available anymore. Please use the main Exam Page.PCAP Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
vlobachevsky
Highly Voted 3 years, 7 months agomazimir
3 years, 7 months agoDamon54
Most Recent 1 year, 3 months agomplopez
1 year, 8 months agoJanpcap123
1 year, 8 months agodicksonpwc
2 years, 1 month ago9prayer
2 years, 3 months agoMallie
2 years, 5 months agoJnanada
2 years, 9 months agoBaldridge
2 years, 12 months agomacxsz
3 years agoMTLE
3 years, 1 month agomacxsz
3 years agoNoarmy315
3 years, 4 months ago