1/12
1.6-1.10 3.1-3.5 9.9 10.6, 10.8, 10.10-10.13
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
syntax
structure of a program and rules abt the structure
Who or what typically finds syntax errors
compiler / interpreter
Who or what typically finds runtime errors
interpreter
runtime error
error does not appear until you run the program
semantic error
program will run but not deliver the correct result
important part of debugging
boundary conditions
what does strings are immutable mean
cannot change an existing string
what operator concatenates a list
+
lists are mutable means
change an item in a list by accessing it directly as part of the assignment statement using an []
how to insert elements in a list
squeezing them into an empty slice at the desired location
ex:
alist = ['a', 'd', 'f']
alist[1:1] = ['b', 'c']
print(alist)
alist[4:4] = ['e']
print(alist)
['a', 'b', 'c', 'd', 'f']
['a', 'b', 'c', 'd', 'e', 'f']
what does the is operator do
test whether two names refer to the same object
is operator will return true if the two references are to the same object
what is a list
collection of references to objects
aliased
same list has two different names