CMPT 120 Lecture Notes - Lecture 23: External Storage, Text Editor, Flash Memory
meghan78 and 39786 others unlocked
29
CMPT 120 Full Course Notes
Verified Note
29 documents
Document Summary
When we shut down an application (e. g. : python idle, word or excel) and/or turn off our computer, often we do not want our information (code, data) to disappear. We want our information to persist until the next time we use it. We achieve persistence by saving our information to files on external storage like hard disk, flash memory, etc We can use text files to store the input/output data. The sequence of 0"s and 1"s represents human-readable characters, i. e. , To view the content of a text file, one needs to use the appropriate application such as a text editor (notepad). Example: open or read text files to get data in to the program, or to write from a program. #hardcode data inside program. quiz1 = 45 quiz2 = 56 total = quiz1 + quiz2 print(total_mark) #get data using input() function. quiz1 = int(input()) quiz2 = int(input()) total = quiz1 + quiz2 print(total_mark)