Test 3 Chapters 7, 8, and 9 Flashcards
Using floating-point numbers can lead to arithmetic errors because floating-point numbers
approximate values
To read a list of lists that’s stored in a binary file, you use
the load() method of the pickle module
A binary file is like a text file in all but one of the following ways. Which one is it?
A binary file stores numbers with binary notation.
A method for creating an object in a class.
constructor
CSV File
is a type of text file that stores multiple values in each line (.csv)
The csv module is a standard module so you don’t need to import it
Which of the following is not true about a CSV file?
Decimal Class
a decimal object that stores a decimal number
Exact Value
exact value that yields expected results
Except Clause
except is used to catch and handle the exception(s) that are encountered in the try clause.
Exception
occurs when you try to open a file that does not exist and the program crashes
exit()
To cancel the execution of a program in the catch clause of a try statement, you can use the
ceil()
returns ceiling value of x i.e., the smallest integer not less than x.
FileNotFoundError
If a program attempts to read from a file that does not exist, which of the following will catch that error?
Finally Clause
a part of a try block that is executed no matter how the try block is exited
float(data)
method is used to return a floating point number from a number or a string.
int(data)
method is used to return an integer point from a number.
Floating-Point Error
It’s a problem caused when the internal representation of floating-point numbers, which uses a fixed number of binary digits to represent a decimal number
Floating-Point Number
any number with a decimal point