CAS CS 111 Lecture 2: Lecture 2
cherryberry1035 and 38883 others unlocked
48
CAS CS 111 Full Course Notes
Verified Note
48 documents
Document Summary
What is the output of the following program: picobot x float. Trace question step through each variable: this is a skill that must be perfected, for example: this is the function posted on the powerpoint slides for this lecture, x, 5, 9, 9, 11 y. Assignment statements/reassignment: you can write over any variable, but any other variable that is a function of the other variable stays the same. The time at which we give a value to a variable matters. Negative indices: count from the end instead of the beginning starting from -1 at the end of the string. Skip slicing: s[0:8:2] start at index 0, stop just before 8, go 2 characters at a time. When you do a slice operation on a list, you get a list back as the data type. If you just print an index, you will get back an int, float, etc.