CSC 110 Final: CSC110 Final Exam 1

53 views7 pages

Document Summary

Csc 110 sample final exam #1: while loop simulation. Function call output mystery(5, 0) _______________________________ mystery(3, 2) _______________________________ mystery(16, 5) _______________________________ mystery(80, 9) _______________________________ mystery(1600, 40) _______________________________ Given the classes above, what output is produced by the following code? elements = [a(), b(), c(), d()] for i in range(0, len(elements)): print(elements[i]) elements[i]. method1() print() elements[i]. method2() print() print(: collections mystery. Consider the following method: def mystery(data, pos, n): result = set() for i in range(0, n): for j in range(0, n): result. add(data[i + pos][j + pos]) return result. Suppose that a variable called grid has been declared as follows: grid = [[8, 2, 7, 8, 2, 1], [1, 5, 1, 7, 4, 7], [4, 2, 6, 9, 2, 3], [2, 2, 8, 1, 1, 3]] which means it will store the following 6-by-6 grid of values: For each call below, indicate what value is returned. If the function call results in an error, write "error" instead.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers

Related Documents

Related Questions