Python Final Exam - Spring 2024, Questions and Answers When a program is finished using a file, it should do this. erase the file open the file close
... [Show More] the file encrypt the file The contents of this type of file can be viewed in an editor such as Notepad. English file binary file image file text file This type of file contains data that has not been converted to text. text file binary file symbolic file unicode file When working with this type of file, you access its data from the beginning of the file to the end of the file. direct access sequential access random access binary access When working with this type of file, you can jump directly to any piece of data in the file without reading the data that comes before it. sequential access binary access ordered access direct access This is a small "holding section" in memory that many systems write data to before writing the data to a file. virtual file variable temporary file buffer You write this statement to respond to exceptions. run/handle try/handle try/except attempt/except This is the first index in a string. 0 The size of the string minus one 1 -1 0 This is the last index in a string. size of the string minus one 0 1 This will happen if you try to use an index that is out of range for a string. ValueError exception IndexError exception String will be erased and the program will continue to run nothing, invalid index will be ignored This function returns the length of a string lengthof size length len This string method returns a copy of the string with all leading whitespace characters removed. lstrip strip_leading remove rstrip This string method returns the lowest index in the string where a specified substring is found. index_of locate find first_index_of This operator determines whether one string is contained inside another string. is_in contains == in This string method returns true if a string contains only alphabetic characters and is at least one character in length. the numeric method the isalpha method the isdigit method the isnumber method This string method returns a copy of the string with all leading and trailing whitespace characters removed. rstrip remove_whitespace clean strip You can use the _________ operator to determine whether a key exists in a dictionary. ^ in ? & You use _________ to delete an element from a dictionary. erase delete del remove [Show Less]