CMPT 120 Lecture Notes - Lecture 4: Recommender System, Boolean Expression

29
CMPT 120 Full Course Notes
Verified Note
29 documents
Document Summary
How to analyze a huge chunk of data and make some comments about it. Step 2: write your code in main. py. Open(filename, r") -> open a file and use it for reading. Open(filename, w") -> open a file and use it for writing. Mystring. split( . ) = split up a string at each comma. This returns a week of items without the commas. Use split to split up a string into its elements and store it into a list. Accessing the first item in the list (can access a specific element, like 1st, Sublists (list within a list) count as 1 item. Print(alist[2][0] -> finds the 3nd item(starts from 0), then the 1st item of the 3rd item (can be the 1st letter/number/digit) My score equals 5 -> myscore == 5. My score is greater than 5 -> myscore > 5. My score is less than 5 -> myscore < 5.