CSC108H1 Midterm: UTSG CSC 108 t2.w12.eve.soln

114 views4 pages
7 Mar 2019
School
Course
Professor
yifanyang and 39659 others unlocked
CSC108H1 Full Course Notes
21
CSC108H1 Full Course Notes
Verified Note
21 documents

Document Summary

For each block of code in this question, write its output in the box below it. If it would generate an error, say so, and give the reason for the error. [1 mark] inner2 = [ pizza", party"] nested = [inner2[:], inner2[:]] nested[0]. insert(1, "birthday") print nested. [2 marks] inner2 = [ x", y", z"] nested2 = [inner2, inner2] print nested2[1] [["x", "y", "z", "new"], ["x", "y", "z", "new"] In a2, a board was a list of lists of strs where each inner list represented a row on the board. Complete the following function, according to its docstring description. def display_column(board, col): (list of lists of strs, int) -> nonetype. You may assume: 0 <= col < len(board)""" for row in range(len(board)): print board[row][col] [5 marks] complete the following function according to its docstring description. def is_first_letter(sentences, letter): (list of lists of strs, str) -> bool.

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

Related Documents