Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Python Institute Exam PCAP-31-03 Topic 5 Question 76 Discussion

Actual exam question for Python Institute's PCAP-31-03 exam
Question #: 76
Topic #: 5
[All PCAP-31-03 Questions]

What is the expected out of the following code of the file named zero_length_existing_file is a zero-length file located inside the working directory?

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

Yong
1 months ago
I bet the answer is 'a partridge in a pear tree'. Or maybe 'the meaning of life, the universe, and everything'. Who knows, these coding questions can be so random sometimes!
upvoted 0 times
Chandra
27 days ago
A) 0
upvoted 0 times
...
...
Dorsey
1 months ago
D, definitely D! 2 is the answer, no doubt about it. Why? Because... well, just because!
upvoted 0 times
...
Ronny
1 months ago
Oh, I know this one! The correct answer has to be C, an errno value corresponding to file not found. That's gotta be it, right?
upvoted 0 times
Arlette
9 days ago
D) 2
upvoted 0 times
...
Veronica
16 days ago
C) an errno value corresponding to file not found
upvoted 0 times
...
Shaun
27 days ago
B) -1
upvoted 0 times
...
Rosendo
30 days ago
A) 0
upvoted 0 times
...
...
Melodie
1 months ago
Wait, is this a trick question? I'm not so sure about 0 anymore. Maybe -1 is the correct answer, since it's a zero-length file and all.
upvoted 0 times
Antonio
21 days ago
User 2: I'm not so sure about that. I believe the correct answer is B) -1.
upvoted 0 times
...
Glendora
26 days ago
User 1: I think the answer is A) 0.
upvoted 0 times
...
...
Carolann
2 months ago
But the question specifies that it's a zero-length file, so I still think it's A) 0.
upvoted 0 times
...
Mitsue
2 months ago
I disagree, I believe it should be B) -1 because the file is empty.
upvoted 0 times
...
Bettina
2 months ago
Hmm, interesting. The file is zero-length, so I'm guessing the answer is 0. That seems like the most logical choice.
upvoted 0 times
Latosha
5 days ago
User1: Let's go with 0 as the answer.
upvoted 0 times
...
Sarah
23 days ago
User3: It could also be an errno value for file not found.
upvoted 0 times
...
King
30 days ago
User2: I agree, a zero-length file should return 0.
upvoted 0 times
...
Wava
1 months ago
User1: I think the answer is 0.
upvoted 0 times
...
...
Carolann
2 months ago
I think the expected output is A) 0.
upvoted 0 times
...

Save Cancel