Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Other

University of California, Berkeley DATA C88C; Final exam cheat sheet (complete updated 2026).

Rating
-
Sold
-
Pages
10
Uploaded on
31-03-2026
Written in
2025/2026

University of California, Berkeley DATA C88C; Final exam cheat sheet (complete updated 2026).

Content preview

Control + Functions
name
expression evaluates to val
-




call expression-calls func
performs
~
def
Keyword parameter
function-mini program that def celsius (tmp) :
specific task
return 9/s * temp + 32
statement-line of code -
return value
operators
-

X 3 *
Y Data
Types
=


+,
-
/, *
-
to val
mutable :
, expression-eval Immutable :
lists
11 float div-cuts off decimal
-

-

int() intw/float - float
· modulus-remainder float() any division-float-dictionanes
-




arrays
-

-
Str() A repeated x times
assignment = +=,
= X =
interval)
:
-



S
-
bool() 2 range (start end ,
> points right var to
-
,
mem -

tuples
~ -



left Str split() optional
address of
.




splits into 1st,
-
func
elem separated -
class instances
conditionals stopsato by space
can live inside immutable obj
caka objects)
mutable data
(expression) :
if
(1 , [2 , 3])
ex + =
~ unlimited/

3
.


return
elif (expression) : none elif is instance (array [i] type ,

return
else : ↳ optional Boolean
return = all other values
Truth
" "
False = O , None ,
loops operators
loops/enters if
=,! =, 3 4 =,
While y
=
3 =

expression True , ,


not-inverts , return T/F
(expression] :
while
and-first F, last T
< body> S or -
first T last F

Caka iteration)
for
for x in 1st : iterate over elem

range (len(ist))
for i in
: iterate over index

ex
. whether largest digit
of cant ben in n only appears once (T/E)
ex .
digite a followed by
of ex .
largest factor n.

digits of n in reverse order
def factor (n) :
def unique-large (n) :



top = 0
def pal(n) factor = n -
1
while n:
m= n while factor > 0 : d = n % 10
while m: if n % factor == 0 : n =
n//10
n = nx10 + m % /0 return factor if d > top :




top d
else =


m//10
:
m =
=
unique True
return n factor -= 1
elif d = =
top :
unique = False
return unique

, LISTS
ordered
-
collection of any data type
make list
1st comprehension optional
1st [X , y , , ] -
(filler exp)]
= z




[map expression) for 1st if
...
x in
index list 1st elem last elem Ist transform and/or filter 1st
returns new
Ist[i] >
- [0] >
-
[len(1st) 1) -
or 1st -

17
[map exp) of <filler exp) else <alternate map

exp> for Jelem) in < 1st]]

Ist methods non inclusive index
create newlst w/oldist
Ist [start
: end : Step] 1st [start ] 1st [end]
:
, ,
newlst = oldist +
[elem ... ,
if > I elem nested 1st
Ist . Append (item) ,
- item Ist ok
in 1st
Ist extend (1st) = append eachelem ex .
append extend
vs
doesn't replace, all other
.




Ist Insert (index , item)
.
- elem move
up one 1st = [5, 10, 15]
1st pop (index) .
- removes +return item if no
index , last item
.
1st .
append ([1 , 5 , 6])
23
1st remove (item)
0
I remove first occurence
2/1s6
.




of item 1st -51015
X in s T if ihm x in S



extendsa
X not in s F If item x ins
S

min(s) ,
max
(s)/ equality 1st
1st 2 bool ,True if items order same
+
1st] ==




Ist] is 1st2 bool , True if pt to same obj in

e
identity memory


Dichonaries - any data type
data to value
ordered type that maps key
- must be unique , immutable
make dict create populate dict pop [key]
3 or d = 53 and d() = a
.




Ekey val
find max/min of all val
...



dict= :
, ...
if included
,

access/update val at
key returnsdefaultfadict max (dict , get)
key dict
get(key default)
= .




dict
(key] = val or dict .
, min (dict key ,
= dict .
get)
append ral to key
append (val)
ADT page
- constructor
on

dict[rey] eX . ADT and dict
keys)
dist iterations dict
returns iterable over keys def split-the bill Corders) :
for dist
key
:
in for order in orders :
witerable of values
for value in dict values: .
if customer /order) not in d .
Keys (1 :


witerates over

dict items : key:val
& [customer Cordel] price (order)
for key , value
=
in .




else :

Skey : val for elem in
1st3 a prehension & [customer Corder)] += price Corder)
return d

Document information

Uploaded on
March 31, 2026
Number of pages
10
Written in
2025/2026
Type
OTHER
Person
Unknown

Subjects

$14.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
MindCraft Nightingale College
View profile
Follow You need to be logged in order to follow users or courses
Sold
320
Member since
1 year
Number of followers
5
Documents
2653
Last sold
5 hours ago
All Academic Solutions 100% non -Ai.

Above all i'm here genuinely to help you in your course work. Do not hesitate to purchase or reach out to me, i'll absolutely get what you need. Get all latest solutions and answer keys, 100% non- ai, all the best.

3.6

42 reviews

5
18
4
9
3
6
2
0
1
9

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions