CSC148H1 Lecture Notes - Lecture 14: Init
katrinasavvy and 38715 others unlocked
1
CSC148H1 Full Course Notes
Verified Note
1 document
Document Summary
References: code seen in the pictures can be found on the csc148 website: http://www. teach. cs. toronto. edu/~csc148h/winter. Special methods: __init_, __str_, __eq__, etc. Inherit methods -> use unchanged: declare class son(father, extend methods -> extend use, override -> replace completely. Test, exceptions: won"t need to write unittest classes/methods, know exception hierarchy. Adts, stacks, queues, sacks: familiar with add/remove/is_empty. Code should fit in the space provided. Search for a phrase in a list of words. Print true if lo" in any of the words in l. Because lo" is in hello", this prints true. Print true for l" in all of the words in l. Since every single world has l", this will print true. If one word doesn"t fit this condition, false will be printed. What makes a sudoku a square valid: valid rows, valid columns, valid subsquares. To code a sudoku, follow the top-down design. Make each method readable -> not too many lines.