CS 1400 exam
24 flashcards · Computer Science · by Elsa Schutfort
A ___ is a template or blueprint that is used to create a ___ of the same type
class and object
Used to create an instance of a class
constructor
The name of the method that is defined to customize an object, and is automatically called when an instance of a class is created
__init__
UML
a way to diagram classes to give a visual representation
self
Used as the first formal parameter of an instance method
Access Operator symbol
.
method
def getMultiple(self, insert): return insert
local variable
def insert(self): multiplier = 8 return insert
setter
a method created in order to change private data so that in can be used
Private method
def __insert(self): self.value += 10
len
the name of the built-in function that will return the number of characters in a string or the number of elements in a list
Operator Overloading
makes it possible to use integer division (//) symbol on an object
__sub__
method that can be defined to change the meaning of minus symbol
interning
if there are a few string variables whose values are the same
Are Strings and Numbers immutable, but Lists are mutable
Yes
Is x = "Apple", "Banana", "Cherry" a list?
No
What does append do?
adds a number to a list
What does pop do?
removes something from the list
index operator
[ ]
== operator
True if strings are the same and False if strings are different... id's do not effect operator
pop
method that removes and returns an element from a list
Insertion Sort
spilt into a sorted and unsorted part. Values from the unsorted part are picked and placed at the correct position in the sorted part.
Binary Search
search method that eliminates half of the possibilities after each iteration of the search loop
Scan all number, keeping track of value and location of smallest so far, update when find something smaller
Selection Sort