INSY 3300 - Final EXAM (T and F and
MC) (75 Questions) with Correct
Answers
When working with a sequential access file, you can jump directly to any piece of
data in the file without reading the data that comes before it. - --Answer --F
When you open a file that file already exists on the disk using the 'w' mode, the
contents of the existing file will be erased. - --Answer --T
The process of opening a file is only necessary with input files. Output files are
automatically opened when data is written to them. - --Answer --F
When an input file is opened, its read position is initially set to the first item in the
file - --Answer --T
When a file that already exists is opened in append mode, the file's existing
contents are erased. - --Answer --F
If you do not handle an exception, it is ignored by the Python interpreter, and the
program continues to execute. - --Answer --F
....COPYRIGHT ©️ 2025 ALL RIGHTS RESERVED...TRUSTED & VERIFIED 1
, You can have more than one except clause in a try/except statement. - --
Answer --T
The else suite in a try/except statement executes only if a statement in the try suite
raises an
exception. - --Answer --F
The finally suite in a try/except statement executes only if no exceptions are raised
by statements in the try suite. - --Answer --F
What will the following code display?
try:
x = float('abc123')
print('The conversion is complete.')
except IOError:
print('This code caused an IOError.')
except ValueError:
print('This code caused a ValueError.')
print('The end.') - --Answer --This Code caused a Value Error. \n The end.
What will the following code display?
....COPYRIGHT ©️ 2025 ALL RIGHTS RESERVED...TRUSTED & VERIFIED 2
MC) (75 Questions) with Correct
Answers
When working with a sequential access file, you can jump directly to any piece of
data in the file without reading the data that comes before it. - --Answer --F
When you open a file that file already exists on the disk using the 'w' mode, the
contents of the existing file will be erased. - --Answer --T
The process of opening a file is only necessary with input files. Output files are
automatically opened when data is written to them. - --Answer --F
When an input file is opened, its read position is initially set to the first item in the
file - --Answer --T
When a file that already exists is opened in append mode, the file's existing
contents are erased. - --Answer --F
If you do not handle an exception, it is ignored by the Python interpreter, and the
program continues to execute. - --Answer --F
....COPYRIGHT ©️ 2025 ALL RIGHTS RESERVED...TRUSTED & VERIFIED 1
, You can have more than one except clause in a try/except statement. - --
Answer --T
The else suite in a try/except statement executes only if a statement in the try suite
raises an
exception. - --Answer --F
The finally suite in a try/except statement executes only if no exceptions are raised
by statements in the try suite. - --Answer --F
What will the following code display?
try:
x = float('abc123')
print('The conversion is complete.')
except IOError:
print('This code caused an IOError.')
except ValueError:
print('This code caused a ValueError.')
print('The end.') - --Answer --This Code caused a Value Error. \n The end.
What will the following code display?
....COPYRIGHT ©️ 2025 ALL RIGHTS RESERVED...TRUSTED & VERIFIED 2