BLACK FRIDAY SALE – Unlock Up to 25% OFF on All Exam Prep! - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Python Institute PCAP-31-03 Exam - Topic 4 Question 23 Discussion

Posted by Portia on May 08, 2022 at 07:26 AM

What is the expected output of the following code if the file named existing_text_file is a non-zero length text file located inside the working directory?

Suggested Answer: B

Get Premium PCAP-31-03 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
11 comments · newest first
SH
Shawana 1 year ago
I'm pretty sure it counts the number of lines, right?
VA
Vashti 1 year ago
Wait, how can it be the last line? That seems odd.
NO
Noah 1 year ago
Nah, it's not -1, that's just wrong.
LO
Lourdes 1 year ago
I think it's option A, the first line's length.
CO
Coral 1 year ago
It's definitely the length of the last line!
CA
Carlee 1 year ago
I feel like -1 could be a possible output if there's an error, but I don't recall the specifics of this code.
WA
Wava 1 year ago
I practiced a similar question where it counted lines, but this one seems to focus on line lengths.
SA
Sabina 1 year ago
I'm not entirely sure, but I remember something about reading lines from files. Could it be the length of the first line instead?
RE
Reita 1 year ago
I think the code reads the last line, so it might return the length of that line.
FR
Freeman 1 year ago
I'm a little confused by this question. I don't use this email client, so I'm not sure what the standard icon would be. I'll have to make an educated guess.
KI
Kizzy 1 year ago
This looks like a pretty straightforward question about using TOGAF to ensure consistency across multiple implementation sites. I think the key is to focus on the Architecture Contracts and how to use them to govern the process.
0/2000 characters

Save Cancel