CSC108H1 Lecture 3: lecture3
yifanyang and 39659 others unlocked
21
CSC108H1 Full Course Notes
Verified Note
21 documents
Document Summary
# afterwards: a referred to 10, b referred to 7 a = 75 age = 75. # - start with letter or underscore (_) # - can include letters (and digits and _) # - case of letters matters age = 39 age = 47. # way to have variable refer to a value. # variable_name = an expression that evaluates to a value. # (1) figure out value of expression (it is 6) # (2) create variable y if does not already exist, # then set y to refer to 6. # or if y already exists, change what it refers to. # variable assignment worksheet k = 5 j = 3 * k. # (b) x = 4 y = 5 x = 2. # (c) x = 4 y = x + 2 x = y + 1. # want code to change so that a refers to 67, b 14.