Python examples math formulas assignment statements lists and slices len(L), L.append(s), L.extend([1,2]) ... tuples are immutable lists x = (1,2,3) Booleans: False and True 2 > 3 L[1] == 2 2 in L defining functions (factorial) Manipulating directories and files: os and os.path modules import os os.getcwd() = returns string which names current dir os.chdir("C:/") or os.chdir("C:\\") myfile = open("....") s = myfile.readline() ss = myfile.readlines() *********************************************** Updating lists L = [1,2,3,5] L[:1] = [3,4] >>> L [3, 4, 2, 3, 5] >>> L[0] = [7,8] >>> L [[7, 8], 4, 2, 3, 5] >>> DICTIONARIES d = {} d[1] = "sal" d["never"] = "val" d[(2,2)] = "hal" d.keys() d.values() d.items() When your program opens the percept file, use: pfile = open('./percepts.txt') Two approaches to reading data structures from files: [Yes , Happy] --> using r = pfile.readline() and then parsing it ["Yes" , "Happy"] --> using p = eval(pfile.readline()) Please use the SECOND approach this time, as shown in the assignment. Classes and OO programs: next time example programs: factorial.py, count.py, vacuum.py and match.py