COMPSCI 61A Midterm: cs61A-fa2014-mt1-Denero-exam

17 views12 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) 2: (12 points) world cup (a) (10 pt) for each of the expressions in the tables below, write the output displayed by the interactive python interpreter when the expression is evaluated. 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. The rst three rows have been provided as examples. Error argentina(1)(square) germany(1)(square) germany(2)(germany) (b) (2 pt) fill in the blank with an expression so that the whole expression below evaluates to a number. 10 def peace(today): harmony = love+2 return harmony + today(love+1) def joy(peace): peace, love = peace+2, peace+1 return love // harmony love, harmony = 3, 2 peace(joy)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers