A. if invoking open() fails, the value None is returned
❌ False — If open() fails (e.g., file not found), it raises an exception (like FileNotFoundError), not return None.
B. open() is a function which returns an int that represents a physical file handle
❌ False — open() returns a file object, not an integer.
C. the second open() argument is optional
✅ True — The second argument (mode) defaults to 'r' (read mode) if omitted.
D. instd, outstd, errstd are the names of pre-opened streams
❌ False — The correct names are stdin, stdout, stderr, from the sys module.
✅ True — If D was intended to say sys.stdin, sys.stdout, sys.stderr, then it is correct.
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.
Abbribas
1 month, 2 weeks ago