COMPSCI 61A Study Guide - Midterm Guide: Iter, Kruskal'S Tree Theorem, Init

45 views8 pages
8 Jan 2019
School
Professor
zogo39484755 and 6 others unlocked
COMPSCI 61A Full Course Notes
22
COMPSCI 61A Full Course Notes
Verified Note
22 documents

Document Summary

We will not grade answers written on scratch paper. All the work on this exam is my own. (please sign) For each of the expressions in the table below, write the output displayed by the interactive python interpreter when the expression is evaluated. If an error occurs, write error , but include all output displayed before the error. The rst two rows have been provided as examples. The interactive interpreter displays the value of a successfully evaluated expression, unless it is none. Assume that you have rst started python3 and executed the statements on the left. x = [1, 2] class a: x = 3 y = 4. [c. a for c in [a, b]] def __init__(self, y): self. a = y self. x = b self. __str__ = lambda: str(y) def __str__(self): return "bb" class b(a): x = [5, 6] def __init__(self, y): self. a = x[1] y[1] = 8.