COMPSCI 61A Study Guide - Midterm Guide: Cheat Sheet

19 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

If you are not sure of your answer you may wish to provide a brief explanation. All the work on this exam is my own. (please sign) For each of the following call expressions, write the value to which it evaluates and what would be output by the interactive python interpreter. The rst two rows have been provided as examples: in the evaluates to column, write the value to which the expression evaluates. If evaluation causes an error, write error: in the column labeled interactive output, write all output that would be displayed during an interactive session, after entering each call expression. Whenever the interpreter would report an error, write error. You should include any lines displayed before an error. Reminder : the interactive interpreter displays the value of a successfully evaluated expression, unless it is none. 1/0 add(square(2), mul(3, 4)) print(print(print(2))) cat(3, 4) square(cat(5)) cat(square(2), print(5)) cat(print(square(3)), 8)