CSC108H1 Lecture Notes - Lecture 3: Computer Memory, Short Circuit, Precondition
yifanyang and 39659 others unlocked
21
CSC108H1 Full Course Notes
Verified Note
21 documents
Document Summary
Capital letters are less than lowercase letters: but b>a. Values of different types can be compared for equality, but cannot usually be compared for ordering (e. g. int and float can be compared to each other len (str): return the number of characters in str. And: true only if a and b are both true. Or (lowest precedence: true if either a or b are true. Short circuit evaluation as soon as you know the answer, give it. Computer memory stores binary values (0"s or 1"s) False is represented by 0, true is represented by 1. Precondition: the conditions under which a statement is intended to work. Elif expressions: 0 or more elif clause. Else expressions: 0 or 1 else clause; must be last. For positive numbers: e. g. s[3: start counting 0 the left. For negative numbers: e. g. s[-12: start counting -1 from the right (last digit)