Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 26 2016, 10:47:25) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "copyright", "credits" or "license()" for more information. >>> WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable. Visit http://www.python.org/download/mac/tcltk/ for current information. ========== RESTART: /Volumes/USB20FD/csc111/lec15/file_practice.py ========== This is a test file. Author: Sara Mathieson Hello World! We are testing out writing files. This is the end of the file. >>> ========== RESTART: /Volumes/USB20FD/csc111/lec15/file_practice.py ========== This is a test file. Author: Sara Mathieson Hello World! We are testing out writing files. This is the end of the file. >>> string = "hello\nworld\n" >>> string 'hello\nworld\n' >>> print(string) hello world >>> string.split() ['hello', 'world'] >>> >>> >>> string = "\n\n\n\n \t \n\n hello \n\n\n\ \t \n" >>> string '\n\n\n\n \t \n\n hello \n\n\n\\ \t \n' >>> string.strip() 'hello \n\n\n\\' >>> string = "\n\n\n\n \t \n\n hello \n\n\n \t \n" >>> string.strip() 'hello' >>> string '\n\n\n\n \t \n\n hello \n\n\n \t \n' >>> string = string.strip() >>> string 'hello' >>> ========== RESTART: /Volumes/USB20FD/csc111/lec15/file_practice.py ========== This is a test file. Author: Sara Mathieson Hello World! We are testing out writing files. This is the end of the file. >>> ========== RESTART: /Volumes/USB20FD/csc111/lec15/file_practice.py ========== This is a test file. Author: Sara Mathieson Hello World! We are testing out writing files. This is the end of the file. >>> ========== RESTART: /Volumes/USB20FD/csc111/lec15/file_practice.py ========== This is a test file. Author: Sara Mathieson Hello World! We are testing out writing files. This is the end of the file. >>> ========== RESTART: /Volumes/USB20FD/csc111/lec15/file_practice.py ========== Traceback (most recent call last): File "/Volumes/USB20FD/csc111/lec15/file_practice.py", line 47, in main() File "/Volumes/USB20FD/csc111/lec15/file_practice.py", line 28, in main for i in num_lines: TypeError: 'int' object is not iterable >>> ======= RESTART: /Volumes/USB20FD/csc111/lec15/number_file_practice.py ======= 17 10 1 12 5 18 15 16 6 14 >>> ======= RESTART: /Volumes/USB20FD/csc111/lec15/number_file_practice.py ======= 17 10 1 12 5 18 15 16 6 14 >>> ======= RESTART: /Volumes/USB20FD/csc111/lec15/number_file_practice.py ======= 17 10 1 12 5 18 15 16 6 14 >>> ======= RESTART: /Volumes/USB20FD/csc111/lec15/number_file_practice.py ======= 17 3 10 3 1 2 12 3 5 2 18 3 15 3 16 3 6 2 14 3 >>> ======= RESTART: /Volumes/USB20FD/csc111/lec15/number_file_practice.py ======= 17 2 10 2 1 1 12 2 5 1 18 2 15 2 16 2 6 1 14 2 >>> ======= RESTART: /Volumes/USB20FD/csc111/lec15/number_file_practice.py ======= 17 10 1 12 5 18 15 16 6 14 >>> ======= RESTART: /Volumes/USB20FD/csc111/lec15/number_file_practice.py ======= Traceback (most recent call last): File "/Volumes/USB20FD/csc111/lec15/number_file_practice.py", line 25, in main() File "/Volumes/USB20FD/csc111/lec15/number_file_practice.py", line 19, in main num_lst = num_lst + num TypeError: can only concatenate list (not "int") to list >>> ======= RESTART: /Volumes/USB20FD/csc111/lec15/number_file_practice.py ======= 17 10 1 12 5 18 15 16 6 14 >>> ======= RESTART: /Volumes/USB20FD/csc111/lec15/number_file_practice.py ======= [17, 17, 10, 10, 1, 1, 12, 12, 5, 5, 18, 18, 15, 15, 16, 16, 6, 6, 14, 14] >>> ======= RESTART: /Volumes/USB20FD/csc111/lec15/number_file_practice.py ======= [17, 10, 1, 12, 5, 18, 15, 16, 6, 14] >>> ======= RESTART: /Volumes/USB20FD/csc111/lec15/number_file_practice.py ======= Range is 17 [17, 10, 1, 12, 5, 18, 15, 16, 6, 14] 1 >>> ======= RESTART: /Volumes/USB20FD/csc111/lec15/number_file_practice.py ======= [17, 10, 1, 12, 5, 18, 15, 16, 6, 14] 1 >>> ======= RESTART: /Volumes/USB20FD/csc111/lec15/number_file_practice.py ======= [17, 10, 1, 12, 5, 18, 15, 16, 6, 14] 1 18 >>>